{"thread":{"id":"7959","subject":"[PATCH] Allow PERL_PATH=\"/usr/bin/env perl\"","startedAt":"2007-05-03T20:33:49Z","lastAt":"2007-05-03T22:58:00Z","messageCount":3,"participants":["Bryan Larsen","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"40979","messageId":"463A472D.5000007@larsen.st","threadId":"7959","inReplyTo":null,"subject":"[PATCH] Allow PERL_PATH=\"/usr/bin/env perl\"","fromName":"Bryan Larsen","fromEmail":"bryan@larsen.st","sentAt":"2007-05-03T20:33:49Z","receivedAt":"2007-05-03T20:33:49Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"The perl scripts start with \"#!/usr/bin/perl\".  There is a mechanism \nPERL_PATH in the Makefile to change this, but it currently doesn't work \nwith PERL_PATH=\"/usr/bin/env perl\".  This is causing problems in \nMacPorts, where we wish to work with the MacPorts perl if it is \ninstalled, but fall back to the system perl if it isn't.\n\nSigned-off-by: Bryan Larsen <bryan@larsen.st>\n---\n  perl/Makefile |    2 +-\n  1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/perl/Makefile b/perl/Makefile\nindex 17d004e..2832cb4 100644\n--- a/perl/Makefile\n+++ b/perl/Makefile\n@@ -33,7 +33,7 @@ $(makfile): ../GIT-CFLAGS Makefile\n         echo '  echo $(instdir_SQ)' >> $@\n  else\n  $(makfile): Makefile.PL ../GIT-CFLAGS\n-       '$(PERL_PATH_SQ)' $< PREFIX='$(prefix_SQ)'\n+       $(PERL_PATH_SQ) $< PREFIX='$(prefix_SQ)'\n  endif\n\n  # this is just added comfort for calling make directly in perl dir\n-- \n1.5.1.3\n"},{"id":"40984","messageId":"20070503212618.GC16538@spearce.org","threadId":"7959","inReplyTo":"463A472D.5000007@larsen.st","subject":"Re: [PATCH] Allow PERL_PATH=\"/usr/bin/env perl\"","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-05-03T21:26:18Z","receivedAt":"2007-05-03T21:26:18Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Bryan Larsen <bryan@larsen.st> wrote:\n> The perl scripts start with \"#!/usr/bin/perl\".  There is a mechanism \n> PERL_PATH in the Makefile to change this, but it currently doesn't work \n> with PERL_PATH=\"/usr/bin/env perl\".  This is causing problems in \n> MacPorts, where we wish to work with the MacPorts perl if it is \n> installed, but fall back to the system perl if it isn't.\n> \n> Signed-off-by: Bryan Larsen <bryan@larsen.st>\n> ---\n>  perl/Makefile |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/perl/Makefile b/perl/Makefile\n> index 17d004e..2832cb4 100644\n> --- a/perl/Makefile\n> +++ b/perl/Makefile\n> @@ -33,7 +33,7 @@ $(makfile): ../GIT-CFLAGS Makefile\n>         echo '  echo $(instdir_SQ)' >> $@\n>  else\n>  $(makfile): Makefile.PL ../GIT-CFLAGS\n> -       '$(PERL_PATH_SQ)' $< PREFIX='$(prefix_SQ)'\n> +       $(PERL_PATH_SQ) $< PREFIX='$(prefix_SQ)'\n>  endif\n\nThis will break if someone actually had ' in their PERL_PATH:\n\n\tPERL_PATH=\"/path'to'perl\"\n\nas PERL_PATH_SQ tries to close the single quoted string you don't\nopen anymore.  That is because it is defined to be PERL_PATH,\nbut with all ' replaced by '\\''.\n\nThis change also breaks for anyone who had spaces in their PERL_PATH.\n\nCan I ask why you can't just supply a small wrapper shellscript\nwith MacPorts\n\n\tcat >perl <<EOF\n\t#!/bin/sh\n\texec env perl \"$@\"\n\tEOF\n\tchmod a+x perl\n\n?  Or better yet, supply Git the correct Perl path?  If/when we ever\ngo to native Perl libraries again a Git Perl library compiled for\nthe system perl may not work later when the user installs a newer\nMacPorts perl.  Switching automatically to the MacPorts perl without\nrecompiling the native extensions is a little evil...\n\n-- \nShawn.\n"},{"id":"40988","messageId":"463A68F8.4010709@larsen.st","threadId":"7959","inReplyTo":"20070503212618.GC16538@spearce.org","subject":"Re: [PATCH] Allow PERL_PATH=\"/usr/bin/env perl\"","fromName":"Bryan Larsen","fromEmail":"bryan@larsen.st","sentAt":"2007-05-03T22:58:00Z","receivedAt":"2007-05-03T22:58:00Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Shawn O. Pearce wrote:\n> Bryan Larsen <bryan@larsen.st> wrote:\n>> The perl scripts start with \"#!/usr/bin/perl\".  There is a mechanism \n>> PERL_PATH in the Makefile to change this, but it currently doesn't work \n>> with PERL_PATH=\"/usr/bin/env perl\".  This is causing problems in \n>> MacPorts, where we wish to work with the MacPorts perl if it is \n>> installed, but fall back to the system perl if it isn't.\n>>\n>> Signed-off-by: Bryan Larsen <bryan@larsen.st>\n>> ---\n>>  perl/Makefile |    2 +-\n>>  1 files changed, 1 insertions(+), 1 deletions(-)\n>>\n>> diff --git a/perl/Makefile b/perl/Makefile\n>> index 17d004e..2832cb4 100644\n>> --- a/perl/Makefile\n>> +++ b/perl/Makefile\n>> @@ -33,7 +33,7 @@ $(makfile): ../GIT-CFLAGS Makefile\n>>         echo '  echo $(instdir_SQ)' >> $@\n>>  else\n>>  $(makfile): Makefile.PL ../GIT-CFLAGS\n>> -       '$(PERL_PATH_SQ)' $< PREFIX='$(prefix_SQ)'\n>> +       $(PERL_PATH_SQ) $< PREFIX='$(prefix_SQ)'\n>>  endif\n> \n> This will break if someone actually had ' in their PERL_PATH:\n> \n> \tPERL_PATH=\"/path'to'perl\"\n> \n> as PERL_PATH_SQ tries to close the single quoted string you don't\n> open anymore.  That is because it is defined to be PERL_PATH,\n> but with all ' replaced by '\\''.\n\nActually, we should just use $(PERL_PATH) with no _SQ and no quotes. \nThe user is passing in something that is designed to go in a shebang \nline: their funny characters are going to be interpreted by the \ninteractive shell to load the perl interpreter; we want \"make\" to do the \nsame thing.\n\n> \n> This change also breaks for anyone who had spaces in their PERL_PATH.\n\nActually a space didn't work before, but with my patch it works like \nyou'd expect in a shebang line, as the delimiter between the command and \nit's arguments.\n\n> \n> Can I ask why you can't just supply a small wrapper shellscript\n> with MacPorts\n> \n> \tcat >perl <<EOF\n> \t#!/bin/sh\n> \texec env perl \"$@\"\n> \tEOF\n> \tchmod a+x perl\n> \n> ?  Or better yet, supply Git the correct Perl path?  If/when we ever\n> go to native Perl libraries again a Git Perl library compiled for\n> the system perl may not work later when the user installs a newer\n> MacPorts perl.  Switching automatically to the MacPorts perl without\n> recompiling the native extensions is a little evil...\n> \n\nAt that point we just add a single line \"depends_lib port:perl5.8\" to \nthe Portfile and everything magically works for the user.  Right now \nit's only in the git-svnimport part of the Portfile, which is nice: the \nuser doesn't get multiple megabytes worth of perl unless we also need to \ninstall p5-svn-simple.\n\nAn even better fix can be to drop PERL_PATH from the Makefile and \nreplace the shebang line with \"#!/usr/bin/env perl\".  Much simpler, and \nthe right thing to do, in my opinion.\n\ncheers,\nBryan\n"}]}