From: Shawn O. Pearce Date: Thu, 03 May 2007 21:26:18 GMT Subject: Re: [PATCH] Allow PERL_PATH="/usr/bin/env perl" Message-ID: <20070503212618.GC16538@spearce.org> In-Reply-To: <463A472D.5000007@larsen.st> Bryan Larsen wrote: > The perl scripts start with "#!/usr/bin/perl". There is a mechanism > PERL_PATH in the Makefile to change this, but it currently doesn't work > with PERL_PATH="/usr/bin/env perl". This is causing problems in > MacPorts, where we wish to work with the MacPorts perl if it is > installed, but fall back to the system perl if it isn't. > > Signed-off-by: Bryan Larsen > --- > perl/Makefile | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/perl/Makefile b/perl/Makefile > index 17d004e..2832cb4 100644 > --- a/perl/Makefile > +++ b/perl/Makefile > @@ -33,7 +33,7 @@ $(makfile): ../GIT-CFLAGS Makefile > echo ' echo $(instdir_SQ)' >> $@ > else > $(makfile): Makefile.PL ../GIT-CFLAGS > - '$(PERL_PATH_SQ)' $< PREFIX='$(prefix_SQ)' > + $(PERL_PATH_SQ) $< PREFIX='$(prefix_SQ)' > endif This will break if someone actually had ' in their PERL_PATH: PERL_PATH="/path'to'perl" as PERL_PATH_SQ tries to close the single quoted string you don't open anymore. That is because it is defined to be PERL_PATH, but with all ' replaced by '\''. This change also breaks for anyone who had spaces in their PERL_PATH. Can I ask why you can't just supply a small wrapper shellscript with MacPorts cat >perl <