Re: RPM source files should be in CVS (was Re: [GENERAL] psql -l)

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: RPM source files should be in CVS (was Re: [GENERAL] psql -l)
Дата
Msg-id 3B58CD77.C99254A8@alumni.caltech.edu
обсуждение исходный текст
Ответ на Re: RPM source files should be in CVS (was Re: [GENERAL] psql -l)  (Lamar Owen <lamar.owen@wgcr.org>)
Список pgsql-hackers
> > On to the next batch....  There are a few perl and python scripts shipped as
> > examples -- every last one of them shebangs to '/usr/local/perl' or
> > '/usr/local/python' -- to make them usable, I patch this to '/usr/bin/perl'
> > or python, as appropriate.
> Hmm.  Given that they're only examples, and are clearly going to be
> broken until hand-edited on many systems not only RedHat, it's not clear
> that this is worth your worrying about.

Ack! There is a way to write this stuff to be portable. The tricks
change a bit depending on the scripting language you are using, but for
perl this is how the header should look:

#!/bin/sh
# -*- perl -*-
# the line above helps with emacs, and put other comments here...

eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'   & eval 'exec perl -S $0 $argv:q'   if 0;

# real perl code follows...


There is no reason to have a dependency on anything but the location of
sh, which is much more reliable than locations for perl, tcl, etc etc.
Not sure the exact form of this technique for python (maybe the same as
above) but there is a similar but not identical form for tcl code
(examples available on request; the above for perl is demonstrated in
contrib/rserv/*.in).
                        - Thomas


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re: RPM source files should be in CVS (was Re: [GENERAL] psql -l)
Следующее
От: Sean Chittenden
Дата:
Сообщение: IDEA: Multi-master replication possible through spread (or even master-slave)...