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

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: RPM source files should be in CVS (was Re: [GENERAL] psql -l)
Date: 2001-07-21 00:31:51
Message-ID: 3B58CD77.C99254A8@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mark kirkwood 2001-07-21 04:32:41 Re: How Postgresql Compares For Query And Load Operations
Previous Message Tom Lane 2001-07-20 23:56:04 Re: Re: RPM source files should be in CVS (was Re: [GENERAL] psql -l)

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2001-07-21 02:33:48 Re: Virus Emails
Previous Message Tom Lane 2001-07-20 23:56:04 Re: Re: RPM source files should be in CVS (was Re: [GENERAL] psql -l)