{"thread":{"id":"7961","subject":"[PATCH] Try 2: Allow PERL_PATH=\"/usr/bin/env perl\"","startedAt":"2007-05-03T22:58:56Z","lastAt":"2007-05-04T03:30:27Z","messageCount":6,"participants":["Bryan Larsen","Junio C Hamano","Andrew Ruder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"40989","messageId":"463A6930.8090603@larsen.st","threadId":"7961","inReplyTo":null,"subject":"[PATCH] Try 2: Allow PERL_PATH=\"/usr/bin/env perl\"","fromName":"Bryan Larsen","fromEmail":"bryan@larsen.st","sentAt":"2007-05-03T22:58:56Z","receivedAt":"2007-05-03T22:58:56Z","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) $< 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":"40991","messageId":"7vfy6dzf25.fsf@assigned-by-dhcp.cox.net","threadId":"7961","inReplyTo":"463A6930.8090603@larsen.st","subject":"Re: [PATCH] Try 2: Allow PERL_PATH=\"/usr/bin/env perl\"","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-03T23:02:26Z","receivedAt":"2007-05-03T23:02:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bryan Larsen <bryan@larsen.st> writes:\n\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\".\n\nI do not get this whole business.  Why would you even want to\nsupport that to begin with?\n\nThe purpose of PERL_PATH is for you to tell git the path you\nhave your Perl at.  It is not about supplying a small shell\nscript that lets \"env\" to figure it out.\n"},{"id":"40996","messageId":"463A71D7.5060506@larsen.st","threadId":"7961","inReplyTo":"7vfy6dzf25.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Try 2: Allow PERL_PATH=\"/usr/bin/env perl\"","fromName":"Bryan Larsen","fromEmail":"bryan@larsen.st","sentAt":"2007-05-03T23:35:51Z","receivedAt":"2007-05-03T23:35:51Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Junio C Hamano wrote:\n> Bryan Larsen <bryan@larsen.st> writes:\n> \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\".\n> \n> I do not get this whole business.  Why would you even want to\n> support that to begin with?\n> \n> The purpose of PERL_PATH is for you to tell git the path you\n> have your Perl at.  It is not about supplying a small shell\n> script that lets \"env\" to figure it out.\n> \n\nMaybe PERL_PATH should be renamed PERL_SHEBANG or something.  Because if \nyou pass in something that doesn't work on a shebang line (longer than \n32 characters, say), it just won't work.\n\nI was under the impression that \"#!/usr/bin/env perl\" was the \"right\" \nway to invoke perl.  But I'm not doing this because I want to do the \n\"right\" thing.  I'm doing this because it makes this scenario work:\n\n$ sudo port install git-core\ninstalling openssl...\ninstalling openssh...\ninstalling curl...\ninstalling expat...\n\n$ ...\n$ git-send-email ...\n$ ...\n\n$ sudo port install git-svn\ninstalling apr...\ninstalling subversion...\ninstalling perl...\ninstalling p5-svn-simple...\n\ngit-core works fine with stock perl, and we don't want to install extra \nmegabytes of unneeded stuff if it really isn't needed.\n\nCertainly there are other ways of making this work.  But they're all \nuglier than doing the \"right\" thing of \"/usr/bin/env perl\".\n\ncheers,\nBryan\n\nP.S.\nOn Linux, \"#!/usr/bin/env perl -w\" doesn't work.  On OS X it works fine.\n"},{"id":"40998","messageId":"20070504000339.GA2476@localdomain","threadId":"7961","inReplyTo":"7vfy6dzf25.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Try 2: Allow PERL_PATH=\"/usr/bin/env perl\"","fromName":"Andrew Ruder","fromEmail":"andy@aeruder.net","sentAt":"2007-05-04T00:03:39Z","receivedAt":"2007-05-04T00:03:39Z","isPatch":true,"sender":{"key":"andy@aeruder.net","avatar":"https://gravatar.com/avatar/cd5239f6d3c9acac61e817de7f7d497e518415e23720f170a10e0663a7981963?d=mp&s=160"},"body":"On Thu, May 03, 2007 at 04:02:26PM -0700, Junio C Hamano wrote:\n> I do not get this whole business.  Why would you even want to\n> support that to begin with?\n\nThe biggest problem being that on macs it is typical to have two copies\nof perl installed (/usr/bin/perl and /opt/local/bin/perl with\nDarwinPorts or otherwise).  It'd be nice to have a way to tell git\nmakefiles to put #!/usr/bin/env perl at the top so it just pulls\nwhat is first in the path rather than having to hardcode it to either\n/opt/local/bin/perl or /usr/bin/perl.\n\nSay you are packaging a mac os x package of git.  Now for the user to\nrun something like git-svn they'd need the svn bindings obviously, but\nof course, some people install them against their system perl, lots of\npeople install them against their darwinports or otherwise, and it'd be\nreally nice to just have those various perl scripts use whatever the\nperson has set up (going by what they have first in their path).\n\n- Andy\n\n-- \nAndrew Ruder <andy@aeruder.net>\nhttp://www.aeruder.net\n"},{"id":"41000","messageId":"7vy7k5xvt4.fsf@assigned-by-dhcp.cox.net","threadId":"7961","inReplyTo":"463A71D7.5060506@larsen.st","subject":"Re: [PATCH] Try 2: Allow PERL_PATH=\"/usr/bin/env perl\"","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-04T00:43:35Z","receivedAt":"2007-05-04T00:43:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bryan Larsen <bryan@larsen.st> writes:\n\n> Maybe PERL_PATH should be renamed PERL_SHEBANG or something.  Because\n> if you pass in something that doesn't work on a shebang line (longer\n> than 32 characters, say), it just won't work.\n\nI think I see what problem you are trying to solve better now.\nProbably more relevant example on MacOS would be whitespace in\nthe pathname.\n\nI think using the bare $(PERL_PATH) in perl/Makefile is a\nreasonable solution.\n\nAre they any other issues on MacOS?  For example, gitweb.cgi is\nbuilt by replacing the shebang with $(PERL_PATH); I presume that\nyou already are successfully working around the whitespace in\nthe pathname with your \"env perl\" on MacOS?\n"},{"id":"41003","messageId":"463AA8D3.8080000@larsen.st","threadId":"7961","inReplyTo":"7vy7k5xvt4.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Try 2: Allow PERL_PATH=\"/usr/bin/env perl\"","fromName":"Bryan Larsen","fromEmail":"bryan@larsen.st","sentAt":"2007-05-04T03:30:27Z","receivedAt":"2007-05-04T03:30:27Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"\n> \n> Are they any other issues on MacOS?  For example, gitweb.cgi is\n> built by replacing the shebang with $(PERL_PATH); I presume that\n> you already are successfully working around the whitespace in\n> the pathname with your \"env perl\" on MacOS?\n> \n\nI haven't used gitweb.cgi.  All the tests run, including the \ngit-send-email test.  (t4200 patch was sent a couple of days ago).  I \nknow there are several people using git very successfully from MacPorts.\n\nThe biggest problem in OS X has been that the BSD versions of standard \nprograms such as xargs and sed are used instead of the GNU versions. \nThere are currently no problems of that sort.\n\ncheers,\nBryan\n"}]}