logo       

Re: patch to allow extra perl args on #! lines: msg#00002

db.rddtool.munin.general

Subject: Re: patch to allow extra perl args on #! lines

On Monday, 2006-12-04 at 15:00:57 -0500, Bennett Todd wrote:
> Lightly tested, it allowed us to fire up the node code.

> Attached please find a readme followed by the patch, all but the
> first (Makefile) chunk of which were done by the code in the readme.

> -Bennett

> The purpose of this patch is to allow a packager to specify Perl module
> path directories with -I.

> Many munin scripts run Perl with -T, to turn on taint-checking mode.
> Because the Perl interpreter does not accept -T after -I, it is not useful
> to add these arguments to $(PERL). Because -T causes $ENV{PERL5LIB}
> and $ENV{PERLLIB} to be ignored, the module path cannot be modified via
> the run-time environment. This patch therefore adds a tag "@@PERLARGS@@"
> to the supplied perl scripts' hash-bang lines, _after_ the distribution-
> supplied arguments, for use by package maintainers.

> This command line was used in the creation of the patch:

> find . -type f | while read i
> do
> perl -pie '/#!\@\@PERL\@\@/ && s/$/ \@\@PERLARGS\@\@/' $i
> done

> diff -ubr munin-1.3.3.bak/Makefile munin-1.3.3/Makefile
> --- munin-1.3.3.bak/Makefile 2006-11-10 07:39:14.000000000 -0500
> +++ munin-1.3.3/Makefile 2006-12-04 12:26:20.000000000 -0500
> @@ -232,6 +232,7 @@
> -e 's|@@STATEDIR@@|$(STATEDIR)|g' \
> -e 's|@@PERL@@|$(PERL)|g' \
> -e 's|@@PERLLIB@@|$(PERLLIB)|g' \
> + -e 's|@@PERLARGS@@|$(PERLARGS)|g' \
> -e 's|@@PYTHON@@|$(PYTHON)|g' \
> -e 's|@@OSTYPE@@|$(OSTYPE)|g' \
> -e 's|@@HOSTNAME@@|$(HOSTNAME)|g' \
> diff -ubr munin-1.3.3.bak/node/munin-node-configure-snmp.in
> munin-1.3.3/node/munin-node-configure-snmp.in
> --- munin-1.3.3.bak/node/munin-node-configure-snmp.in 2006-11-10
> 07:39:14.000000000 -0500
> +++ munin-1.3.3/node/munin-node-configure-snmp.in 2006-12-04
> 12:19:24.000000000 -0500
> @@ -1,4 +1,4 @@
> -#!@@PERL@@ -w
> +#!@@PERL@@ -w @@PERLARGS@@

> # Copyright (C) 2004-2006 Jimmy Olsen

> diff -ubr munin-1.3.3.bak/node/munin-node-configure.in
> munin-1.3.3/node/munin-node-configure.in
> --- munin-1.3.3.bak/node/munin-node-configure.in 2006-11-10
> 07:39:14.000000000 -0500
> +++ munin-1.3.3/node/munin-node-configure.in 2006-12-04 12:19:24.000000000
> -0500
> @@ -1,4 +1,4 @@
> -#!@@PERL@@ -w
> +#!@@PERL@@ -w @@PERLARGS@@
> # -*- perl -*-

> ... etc ad nauseam ;-)

The problem is that passing more than one argument on the shebang line
isn't portable. Perhaps you should have discussed your problem on this
mailing list. We could have come up with a more portable solution. Now
we don't even know *why* you want to pass -I arguments to perl.

Its definitely not a normal installation.

Lupe Christoph

PS: http://www.in-ulm.de/~mascheck/various/shebang/
--
| You know we're sitting on four million pounds of fuel, one nuclear |
| weapon and a thing that has 270,000 moving parts built by the lowest |
| bidder. Makes you feel good, doesn't it? |
| Rockhound in "Armageddon", 1998, about the Space Shuttle |

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise