{"thread":{"id":"21566","subject":"[PATCH] Define $PERL_PATH in test-lib.sh","startedAt":"2009-11-10T10:46:51Z","lastAt":"2009-11-17T18:25:01Z","messageCount":18,"participants":["Philippe Bruhat (BooK)","Jeff King","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"127237","messageId":"1257850011-7544-1-git-send-email-book@cpan.org","threadId":"21566","inReplyTo":null,"subject":"[PATCH] Define $PERL_PATH in test-lib.sh","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2009-11-10T10:46:51Z","receivedAt":"2009-11-10T10:46:51Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"The main Makefile defines PERL_PATH as the perl to use in the shebang\nline of git*.perl commands. This ensures this will be the perl used\nto run the tests (in case another perl appears in $PATH before the one\ndefined in $PERL_PATH)\n\nSigned-off-by: Philippe Bruhat (BooK) <book@cpan.org>\n---\n t/t9400-git-cvsserver-server.sh |    2 +-\n t/t9401-git-cvsserver-crlf.sh   |    2 +-\n t/t9700-perl-git.sh             |    4 ++--\n t/test-lib.sh                   |    2 ++\n 4 files changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex 64f947d..dc710f8 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -20,7 +20,7 @@ then\n     say 'skipping git-cvsserver tests, cvs not found'\n     test_done\n fi\n-perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n+$PERL_PATH -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n     say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'\n     test_done\n }\ndiff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh\nindex aca40c1..c9e3dba 100755\n--- a/t/t9401-git-cvsserver-crlf.sh\n+++ b/t/t9401-git-cvsserver-crlf.sh\n@@ -57,7 +57,7 @@ then\n     say 'skipping git-cvsserver tests, perl not available'\n     test_done\n fi\n-perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n+$PERL_PATH -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n     say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'\n     test_done\n }\ndiff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh\nindex 4eb7d3f..3354e18 100755\n--- a/t/t9700-perl-git.sh\n+++ b/t/t9700-perl-git.sh\n@@ -11,7 +11,7 @@ if ! test_have_prereq PERL; then\n \ttest_done\n fi\n \n-perl -MTest::More -e 0 2>/dev/null || {\n+$PERL_PATH -MTest::More -e 0 2>/dev/null || {\n \tsay \"Perl Test::More unavailable, skipping test\"\n \ttest_done\n }\n@@ -48,6 +48,6 @@ test_expect_success \\\n \n test_external_without_stderr \\\n     'Perl API' \\\n-    perl \"$TEST_DIRECTORY\"/t9700/test.pl\n+    $PERL_PATH \"$TEST_DIRECTORY\"/t9700/test.pl\n \n test_done\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex f2ca536..54dd4d5 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -730,6 +730,8 @@ esac\n \n test -z \"$NO_PERL\" && test_set_prereq PERL\n \n+test -z \"$NO_PERL\" && test -z \"$PERL_PATH\" && export PERL_PATH=/usr/bin/perl\n+\n # test whether the filesystem supports symbolic links\n ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS\n rm -f y\n-- \n1.6.0.3.517.g759a\n"},{"id":"127238","messageId":"20091110122315.GA15906@coredump.intra.peff.net","threadId":"21566","inReplyTo":"1257850011-7544-1-git-send-email-book@cpan.org","subject":"Re: [PATCH] Define $PERL_PATH in test-lib.sh","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-11-10T12:23:15Z","receivedAt":"2009-11-10T12:23:15Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Nov 10, 2009 at 11:46:51AM +0100, Philippe Bruhat (BooK) wrote:\n\n> The main Makefile defines PERL_PATH as the perl to use in the shebang\n> line of git*.perl commands. This ensures this will be the perl used\n> to run the tests (in case another perl appears in $PATH before the one\n> defined in $PERL_PATH)\n\nI think this \"the perl used to run the tests\" needs to be clarified in\nthe commit message.  There are really three ways we use perl in the\ntests:\n\n  1. To run to the git-* scripts themselves.\n\n  2. To run a test snippet of perl as if we were a git-* script.\n\n  3. To run random perl helper functions.\n\nWe already use PERL_PATH for (1). I don't think there is much point in\nworrying about (3). If the perl in your PATH is so broken that it can't\nbe used for simple helpers, then you should fix your PATH.\n\nYour patch seems to just fix (2), which I think is sane. But I wanted to\nnote it, because when I read your commit message, I wasn't sure which\nyou were doing.\n\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -730,6 +730,8 @@ esac\n>  \n>  test -z \"$NO_PERL\" && test_set_prereq PERL\n>  \n> +test -z \"$NO_PERL\" && test -z \"$PERL_PATH\" && export PERL_PATH=/usr/bin/perl\n> +\n>  # test whether the filesystem supports symbolic links\n>  ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS\n>  rm -f y\n\nWill this work if I just have PERL_PATH in my config.mak in the root\ndirectory? Should we be adding PERL_PATH to the generated\nGIT-BUILD-OPTIONS file in the root, which gets sourced by test-lib?\n\nSomething like the following (completely untested) patch?\n\ndiff --git a/Makefile b/Makefile\nindex a10a60c..b9a8145 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1643,6 +1643,7 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS\n # and the first level quoting from the shell that runs \"echo\".\n GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS\n \t@echo SHELL_PATH=\\''$(subst ','\\'',$(SHELL_PATH_SQ))'\\' >$@\n+\t@echo PERL_PATH=\\''$(subst ','\\'',$(PERL_PATH_SQ))'\\' >$@\n \t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@\n \t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@\n \t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@\n"},{"id":"127239","messageId":"4AF95C0D.90605@viscovery.net","threadId":"21566","inReplyTo":"1257850011-7544-1-git-send-email-book@cpan.org","subject":"Re: [PATCH] Define $PERL_PATH in test-lib.sh","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-11-10T12:26:53Z","receivedAt":"2009-11-10T12:26:53Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Philippe Bruhat (BooK) schrieb:\n> diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\n> index 64f947d..dc710f8 100755\n> --- a/t/t9400-git-cvsserver-server.sh\n> +++ b/t/t9400-git-cvsserver-server.sh\n> @@ -20,7 +20,7 @@ then\n>      say 'skipping git-cvsserver tests, cvs not found'\n>      test_done\n>  fi\n> -perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n> +$PERL_PATH -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n\nShouldn't this be \"$PERL_PATH\", i.e., double-quoted? (Ditto in the other\ncases that you replaced.)\n\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index f2ca536..54dd4d5 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -730,6 +730,8 @@ esac\n>  \n>  test -z \"$NO_PERL\" && test_set_prereq PERL\n>  \n> +test -z \"$NO_PERL\" && test -z \"$PERL_PATH\" && export PERL_PATH=/usr/bin/perl\n\nWouldn't\n\n   ... && export PERL_PATH=perl\n\nbe a safer fall-back?\n\n-- Hannes\n"},{"id":"127242","messageId":"20091110133334.GB8896@plop","threadId":"21566","inReplyTo":"20091110122315.GA15906@coredump.intra.peff.net","subject":"Re: [PATCH] Define $PERL_PATH in test-lib.sh","fromName":"Philippe Bruhat (BooK)","fromEmail":"philippe.bruhat@free.fr","sentAt":"2009-11-10T13:33:34Z","receivedAt":"2009-11-10T13:33:34Z","isPatch":true,"sender":{"key":"philippe.bruhat@free.fr","avatar":"https://gravatar.com/avatar/5e8b60cb2f5f2cd2671543f2f53dcb8f529490f98492a333f96636622eb3adef?d=mp&s=160"},"body":"On Tue, Nov 10, 2009 at 07:23:15AM -0500, Jeff King wrote:\n> On Tue, Nov 10, 2009 at 11:46:51AM +0100, Philippe Bruhat (BooK) wrote:\n> \n> > The main Makefile defines PERL_PATH as the perl to use in the shebang\n> > line of git*.perl commands. This ensures this will be the perl used\n> > to run the tests (in case another perl appears in $PATH before the one\n> > defined in $PERL_PATH)\n\nPERL_PATH is a variable in the Makefile that, if not defined is set up\nto /usr/bin/perl.\n\nIt is used to set the shebang line in the git-* perl scripts.\n\n> I think this \"the perl used to run the tests\" needs to be clarified in\n> the commit message.  There are really three ways we use perl in the\n> tests:\n> \n>   1. To run to the git-* scripts themselves.\n\nYes, this PERL_PATH.\n\n>   2. To run a test snippet of perl as if we were a git-* script.\n\nActually, my goal was to run Makefile.PL with the proper perl (see below).\n\n>   3. To run random perl helper functions.\n\nI didn't replace those ones, because any perl is good enough to do some\nperl -i.bak -pe 's/foo/bar/' processing.\n\n> We already use PERL_PATH for (1). I don't think there is much point in\n> worrying about (3). If the perl in your PATH is so broken that it can't\n> be used for simple helpers, then you should fix your PATH.\n\nThe Perl in my PATH doesn't have Error.pm installed, but /usr/bin/perl\nhas it. When the Makefile.PL is run by /usr/bin/perl, the private-Error.pm\nmodule is not copied in blib. The git-* perl scripts are using the perl\nin PERL_PATH, and therefore can't load Error.pm (not in blib during make test),\ncausing test breakage.\n\nThis is the original reason for this patch. I fixed the general (2) case,\ndeliberately avoiding to replace every call to perl (3).\n\n> Your patch seems to just fix (2), which I think is sane. But I wanted to\n> note it, because when I read your commit message, I wasn't sure which\n> you were doing.\n\nYes.\n\n-- \n Philippe Bruhat (BooK)\n\n Trust only in incompetence. You will never be disappointed.\n                                    (Moral from Groo The Wanderer #16 (Epic))\n"},{"id":"127243","messageId":"20091110133427.GC8896@plop","threadId":"21566","inReplyTo":"4AF95C0D.90605@viscovery.net","subject":"Re: [PATCH] Define $PERL_PATH in test-lib.sh","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2009-11-10T13:34:27Z","receivedAt":"2009-11-10T13:34:27Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"On Tue, Nov 10, 2009 at 01:26:53PM +0100, Johannes Sixt wrote:\n> >  \n> > +test -z \"$NO_PERL\" && test -z \"$PERL_PATH\" && export PERL_PATH=/usr/bin/perl\n> \n> Wouldn't\n> \n>    ... && export PERL_PATH=perl\n> \n> be a safer fall-back?\n\n/usr/bin/perl is the value used in the top-level Makefile.\nI used this for consistency.\n\n-- \n Philippe Bruhat (BooK)\n\n The greatest monster of them all is ignorance.\n                             (Moral to Pal'n Drumm Story in Groo #89 (Epic))\n"},{"id":"127270","messageId":"7v7hty6so9.fsf@alter.siamese.dyndns.org","threadId":"21566","inReplyTo":"20091110133427.GC8896@plop","subject":"Re: [PATCH] Define $PERL_PATH in test-lib.sh","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-10T20:17:26Z","receivedAt":"2009-11-10T20:17:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philippe Bruhat (BooK)\" <book@cpan.org> writes:\n\n> On Tue, Nov 10, 2009 at 01:26:53PM +0100, Johannes Sixt wrote:\n>> >  \n>> > +test -z \"$NO_PERL\" && test -z \"$PERL_PATH\" && export PERL_PATH=/usr/bin/perl\n>> \n>> Wouldn't\n>> \n>>    ... && export PERL_PATH=perl\n>> \n>> be a safer fall-back?\n>\n> /usr/bin/perl is the value used in the top-level Makefile.\n> I used this for consistency.\n\nHmm, but that means two separate definitions in ./Makefile and\nt/test-lib.sh must be kept in sync forever, and there is not even a\ncomment next to the line that requires such care in your patch to help\npeople who might want to change these lines in the future.\n"},{"id":"127298","messageId":"20091111084014.GE8896@plop","threadId":"21566","inReplyTo":"7v7hty6so9.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Define $PERL_PATH in test-lib.sh","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2009-11-11T08:40:14Z","receivedAt":"2009-11-11T08:40:14Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"On Tue, Nov 10, 2009 at 12:17:26PM -0800, Junio C Hamano wrote:\n> \"Philippe Bruhat (BooK)\" <book@cpan.org> writes:\n> \n> > On Tue, Nov 10, 2009 at 01:26:53PM +0100, Johannes Sixt wrote:\n> >> >  \n> >> > +test -z \"$NO_PERL\" && test -z \"$PERL_PATH\" && export PERL_PATH=/usr/bin/perl\n> >> \n> >> Wouldn't\n> >> \n> >>    ... && export PERL_PATH=perl\n> >> \n> >> be a safer fall-back?\n> >\n> > /usr/bin/perl is the value used in the top-level Makefile.\n> > I used this for consistency.\n> \n> Hmm, but that means two separate definitions in ./Makefile and\n> t/test-lib.sh must be kept in sync forever, and there is not even a\n> comment next to the line that requires such care in your patch to help\n> people who might want to change these lines in the future.\n\nIs there a way to obtain whatever value was computed in the Makefile,\nor should I just add a comment in all-caps saying \"keep this in sync\nwith the default value in the top level Makefile\"? (and a more detailed\ncommit message)\n\n-- \n Philippe Bruhat (BooK)\n\n Freedom is not an individual effort. Yours comes only when you grant others\n theirs.                             (Moral from Groo The Wanderer #5 (Epic))\n"},{"id":"127299","messageId":"20091111084316.GA1799@sigill.intra.peff.net","threadId":"21566","inReplyTo":"20091111084014.GE8896@plop","subject":"Re: [PATCH] Define $PERL_PATH in test-lib.sh","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-11-11T08:43:16Z","receivedAt":"2009-11-11T08:43:16Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Nov 11, 2009 at 09:40:14AM +0100, Philippe Bruhat (BooK) wrote:\n\n> > Hmm, but that means two separate definitions in ./Makefile and\n> > t/test-lib.sh must be kept in sync forever, and there is not even a\n> > comment next to the line that requires such care in your patch to help\n> > people who might want to change these lines in the future.\n> \n> Is there a way to obtain whatever value was computed in the Makefile,\n> or should I just add a comment in all-caps saying \"keep this in sync\n> with the default value in the top level Makefile\"? (and a more detailed\n> commit message)\n\nYes. Did you miss the second half of my other message?\n\n  http://article.gmane.org/gmane.comp.version-control.git/132561\n\n-Peff\n"},{"id":"127595","messageId":"7v639cqhh6.fsf@alter.siamese.dyndns.org","threadId":"21566","inReplyTo":"20091110122315.GA15906@coredump.intra.peff.net","subject":"Re: [PATCH] Define $PERL_PATH in test-lib.sh","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-15T09:12:37Z","receivedAt":"2009-11-15T09:12:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Tue, Nov 10, 2009 at 11:46:51AM +0100, Philippe Bruhat (BooK) wrote:\n> (snip)\n> Will this work if I just have PERL_PATH in my config.mak in the root\n> directory? Should we be adding PERL_PATH to the generated\n> GIT-BUILD-OPTIONS file in the root, which gets sourced by test-lib?\n>\n> Something like the following (completely untested) patch?\n\nPhilippe, could you please help getting this topic unstuck with a \"it\nworks\" or \"it doesn't and here is a better solution\"?\n\n> diff --git a/Makefile b/Makefile\n> index a10a60c..b9a8145 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1643,6 +1643,7 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS\n>  # and the first level quoting from the shell that runs \"echo\".\n>  GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS\n>  \t@echo SHELL_PATH=\\''$(subst ','\\'',$(SHELL_PATH_SQ))'\\' >$@\n> +\t@echo PERL_PATH=\\''$(subst ','\\'',$(PERL_PATH_SQ))'\\' >$@\n>  \t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@\n>  \t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@\n>  \t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@\n"},{"id":"127712","messageId":"20091116234849.GA3608@plop","threadId":"21566","inReplyTo":"7v639cqhh6.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Define $PERL_PATH in test-lib.sh","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2009-11-16T23:48:49Z","receivedAt":"2009-11-16T23:48:49Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"On Sun, Nov 15, 2009 at 01:12:37AM -0800, Junio C Hamano wrote:\n> Jeff King <peff@peff.net> writes:\n> \n> > On Tue, Nov 10, 2009 at 11:46:51AM +0100, Philippe Bruhat (BooK) wrote:\n> > (snip)\n> > Will this work if I just have PERL_PATH in my config.mak in the root\n> > directory? Should we be adding PERL_PATH to the generated\n> > GIT-BUILD-OPTIONS file in the root, which gets sourced by test-lib?\n> >\n> > Something like the following (completely untested) patch?\n> \n> Philippe, could you please help getting this topic unstuck with a \"it\n> works\" or \"it doesn't and here is a better solution\"?\n> \n\nI took Jeff's patch the main Makefile, removed my patch to test-lib.sh,\nand it worked. That is to say, the test suite failed on the perl tests\nwhen the first perl in the PATH was my local perl without Error.pm\ninstalled. With the changes, the test suite passed, even with my local\nperl first in the PATH.\n\nPatch with a reworked commit message follows.\n\n-- \n Philippe Bruhat (BooK)\n\n The truly stupid always find a way to create disaster.\n                                                (Moral from Groo #10 (Image))\n"},{"id":"127713","messageId":"1258415600-4656-1-git-send-email-book@cpan.org","threadId":"21566","inReplyTo":"20091116234849.GA3608@plop","subject":"[PATCH] Make sure $PERL_PATH is defined when the test suite is run.","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2009-11-16T23:53:20Z","receivedAt":"2009-11-16T23:53:20Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"Some test scripts run Perl scripts as if they were git-* scripts, and\nthus need to use the same perl that will be put in the shebang line of\ngit*.perl commands. $PERL_PATH therefore needs to be used instead of\na bare \"perl\".\n\nThe tests can fail if another perl is found in $PATH before the one\ndefined in $PERL_PATH.\n\nExample test failure caused by this: the perl defined in $PERL_PATH has\nError.pm installed, and therefore the Git.pm's Makefile.PL doesn't install\nthe private copy. The perl from $PATH doesn't have Error.pm installed, and\nall git*.perl scripts invoked during the test will fail loading Error.pm.\n\nMakefile patch by Jeff King <peff@peff.net>.\n\nSigned-off-by: Philippe Bruhat (BooK) <book@cpan.org>\n---\n Makefile                        |    1 +\n t/t9400-git-cvsserver-server.sh |    2 +-\n t/t9401-git-cvsserver-crlf.sh   |    2 +-\n t/t9700-perl-git.sh             |    4 ++--\n 4 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 35f5294..8e8f981 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1633,6 +1633,7 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS\n # and the first level quoting from the shell that runs \"echo\".\n GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS\n \t@echo SHELL_PATH=\\''$(subst ','\\'',$(SHELL_PATH_SQ))'\\' >$@\n+\t@echo PERL_PATH=\\''$(subst ','\\'',$(PERL_PATH_SQ))'\\' >$@\n \t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@\n \t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@\n \t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@\ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex 64f947d..dc710f8 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -20,7 +20,7 @@ then\n     say 'skipping git-cvsserver tests, cvs not found'\n     test_done\n fi\n-perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n+$PERL_PATH -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n     say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'\n     test_done\n }\ndiff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh\nindex aca40c1..c9e3dba 100755\n--- a/t/t9401-git-cvsserver-crlf.sh\n+++ b/t/t9401-git-cvsserver-crlf.sh\n@@ -57,7 +57,7 @@ then\n     say 'skipping git-cvsserver tests, perl not available'\n     test_done\n fi\n-perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n+$PERL_PATH -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n     say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'\n     test_done\n }\ndiff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh\nindex 4eb7d3f..3354e18 100755\n--- a/t/t9700-perl-git.sh\n+++ b/t/t9700-perl-git.sh\n@@ -11,7 +11,7 @@ if ! test_have_prereq PERL; then\n \ttest_done\n fi\n \n-perl -MTest::More -e 0 2>/dev/null || {\n+$PERL_PATH -MTest::More -e 0 2>/dev/null || {\n \tsay \"Perl Test::More unavailable, skipping test\"\n \ttest_done\n }\n@@ -48,6 +48,6 @@ test_expect_success \\\n \n test_external_without_stderr \\\n     'Perl API' \\\n-    perl \"$TEST_DIRECTORY\"/t9700/test.pl\n+    $PERL_PATH \"$TEST_DIRECTORY\"/t9700/test.pl\n \n test_done\n-- \n1.6.0.3.517.g759a\n"},{"id":"127715","messageId":"7v1vjym2oq.fsf@alter.siamese.dyndns.org","threadId":"21566","inReplyTo":"1258415600-4656-1-git-send-email-book@cpan.org","subject":"Re: [PATCH] Make sure $PERL_PATH is defined when the test suite is run.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-17T00:10:13Z","receivedAt":"2009-11-17T00:10:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philippe Bruhat (BooK)\" <book@cpan.org> writes:\n\n> diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\n> index 64f947d..dc710f8 100755\n> --- a/t/t9400-git-cvsserver-server.sh\n> +++ b/t/t9400-git-cvsserver-server.sh\n> @@ -20,7 +20,7 @@ then\n>      say 'skipping git-cvsserver tests, cvs not found'\n>      test_done\n>  fi\n> -perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n> +$PERL_PATH -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n>      say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'\n>      test_done\n>  }\n\nShouldn't these $PERL_PATH all be quoted inside double-quotes?\n"},{"id":"127717","messageId":"20091117001701.GB3608@plop","threadId":"21566","inReplyTo":"7v1vjym2oq.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Make sure $PERL_PATH is defined when the test suite is run.","fromName":"Philippe Bruhat (BooK)","fromEmail":"philippe.bruhat@free.fr","sentAt":"2009-11-17T00:17:01Z","receivedAt":"2009-11-17T00:17:01Z","isPatch":true,"sender":{"key":"philippe.bruhat@free.fr","avatar":"https://gravatar.com/avatar/5e8b60cb2f5f2cd2671543f2f53dcb8f529490f98492a333f96636622eb3adef?d=mp&s=160"},"body":"On Mon, Nov 16, 2009 at 04:10:13PM -0800, Junio C Hamano wrote:\n> \"Philippe Bruhat (BooK)\" <book@cpan.org> writes:\n> \n> > diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\n> > index 64f947d..dc710f8 100755\n> > --- a/t/t9400-git-cvsserver-server.sh\n> > +++ b/t/t9400-git-cvsserver-server.sh\n> > @@ -20,7 +20,7 @@ then\n> >      say 'skipping git-cvsserver tests, cvs not found'\n> >      test_done\n> >  fi\n> > -perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n> > +$PERL_PATH -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n> >      say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'\n> >      test_done\n> >  }\n> \n> Shouldn't these $PERL_PATH all be quoted inside double-quotes?\n\nI have no idea. I assume it's to protect against paths with a space in\nthem, so yes, probably.\n\nAmending my patch and sending again.\n\n-- \n Philippe Bruhat (BooK)\n\n When you double-cross a friend, you triple-cross yourself.\n                                     (Moral from Groo The Wanderer #8 (Epic))\n"},{"id":"127719","messageId":"1258417206-5406-1-git-send-email-book@cpan.org","threadId":"21566","inReplyTo":"7v1vjym2oq.fsf@alter.siamese.dyndns.org","subject":"[PATCH] Make sure $PERL_PATH is defined when the test suite is run.","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2009-11-17T00:20:06Z","receivedAt":"2009-11-17T00:20:06Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"Some test scripts run Perl scripts as if they were git-* scripts, and\nthus need to use the same perl that will be put in the shebang line of\ngit*.perl commands. $PERL_PATH therefore needs to be used instead of\na bare \"perl\".\n\nThe tests can fail if another perl is found in $PATH before the one\ndefined in $PERL_PATH.\n\nExample test failure caused by this: the perl defined in $PERL_PATH has\nError.pm installed, and therefore the Git.pm's Makefile.PL doesn't install\nthe private copy. The perl from $PATH doesn't have Error.pm installed, and\nall git*.perl scripts invoked during the test will fail loading Error.pm.\n\nMakefile patch by Jeff King <peff@peff.net>.\n\nSigned-off-by: Philippe Bruhat (BooK) <book@cpan.org>\n---\n Makefile                        |    1 +\n t/t9400-git-cvsserver-server.sh |    2 +-\n t/t9401-git-cvsserver-crlf.sh   |    2 +-\n t/t9700-perl-git.sh             |    4 ++--\n 4 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 35f5294..8e8f981 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1633,6 +1633,7 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS\n # and the first level quoting from the shell that runs \"echo\".\n GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS\n \t@echo SHELL_PATH=\\''$(subst ','\\'',$(SHELL_PATH_SQ))'\\' >$@\n+\t@echo PERL_PATH=\\''$(subst ','\\'',$(PERL_PATH_SQ))'\\' >$@\n \t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@\n \t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@\n \t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@\ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex 64f947d..c2ec3cb 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -20,7 +20,7 @@ then\n     say 'skipping git-cvsserver tests, cvs not found'\n     test_done\n fi\n-perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n+\"$PERL_PATH\" -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n     say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'\n     test_done\n }\ndiff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh\nindex aca40c1..40637d6 100755\n--- a/t/t9401-git-cvsserver-crlf.sh\n+++ b/t/t9401-git-cvsserver-crlf.sh\n@@ -57,7 +57,7 @@ then\n     say 'skipping git-cvsserver tests, perl not available'\n     test_done\n fi\n-perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n+\"$PERL_PATH\" -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n     say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'\n     test_done\n }\ndiff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh\nindex 4eb7d3f..96a2e55 100755\n--- a/t/t9700-perl-git.sh\n+++ b/t/t9700-perl-git.sh\n@@ -11,7 +11,7 @@ if ! test_have_prereq PERL; then\n \ttest_done\n fi\n \n-perl -MTest::More -e 0 2>/dev/null || {\n+\"$PERL_PATH\" -MTest::More -e 0 2>/dev/null || {\n \tsay \"Perl Test::More unavailable, skipping test\"\n \ttest_done\n }\n@@ -48,6 +48,6 @@ test_expect_success \\\n \n test_external_without_stderr \\\n     'Perl API' \\\n-    perl \"$TEST_DIRECTORY\"/t9700/test.pl\n+    $PERL_PATH \"$TEST_DIRECTORY\"/t9700/test.pl\n \n test_done\n-- \n1.6.0.3.517.g759a\n"},{"id":"127749","messageId":"4B025F19.1050809@viscovery.net","threadId":"21566","inReplyTo":"1258417206-5406-1-git-send-email-book@cpan.org","subject":"Re: [PATCH] Make sure $PERL_PATH is defined when the test suite is run.","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-11-17T08:30:17Z","receivedAt":"2009-11-17T08:30:17Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Philippe Bruhat (BooK) schrieb:\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1633,6 +1633,7 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS\n>  # and the first level quoting from the shell that runs \"echo\".\n>  GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS\n>  \t@echo SHELL_PATH=\\''$(subst ','\\'',$(SHELL_PATH_SQ))'\\' >$@\n> +\t@echo PERL_PATH=\\''$(subst ','\\'',$(PERL_PATH_SQ))'\\' >$@\n\nMake it: ... >>$@\n\n>  \t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@\n>  \t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@\n>  \t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@\n\n>  test_external_without_stderr \\\n>      'Perl API' \\\n> -    perl \"$TEST_DIRECTORY\"/t9700/test.pl\n> +    $PERL_PATH \"$TEST_DIRECTORY\"/t9700/test.pl\n\nThis one needs the double-quotes as well.\n\n-- Hannes\n"},{"id":"127750","messageId":"20091117083557.GC3608@plop","threadId":"21566","inReplyTo":"4B025F19.1050809@viscovery.net","subject":"Re: [PATCH] Make sure $PERL_PATH is defined when the test suite is run.","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2009-11-17T08:35:57Z","receivedAt":"2009-11-17T08:35:57Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"On Tue, Nov 17, 2009 at 09:30:17AM +0100, Johannes Sixt wrote:\n> Philippe Bruhat (BooK) schrieb:\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -1633,6 +1633,7 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS\n> >  # and the first level quoting from the shell that runs \"echo\".\n> >  GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS\n> >  \t@echo SHELL_PATH=\\''$(subst ','\\'',$(SHELL_PATH_SQ))'\\' >$@\n> > +\t@echo PERL_PATH=\\''$(subst ','\\'',$(PERL_PATH_SQ))'\\' >$@\n> \n> Make it: ... >>$@\n\nThis proves late commits needs many extra pair of eyes. :-)\n\n> >  \t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@\n> >  \t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@\n> >  \t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@\n> \n> >  test_external_without_stderr \\\n> >      'Perl API' \\\n> > -    perl \"$TEST_DIRECTORY\"/t9700/test.pl\n> > +    $PERL_PATH \"$TEST_DIRECTORY\"/t9700/test.pl\n> \n> This one needs the double-quotes as well.\n\nThanks. Sending again. (sorry for the noise)\n\n-- \n Philippe Bruhat (BooK)\n\n \"Did I err?\"      (Groo, in too many issues to count - ...and *YES* he did!)\n"},{"id":"127751","messageId":"1258447359-11392-1-git-send-email-book@cpan.org","threadId":"21566","inReplyTo":"4B025F19.1050809@viscovery.net","subject":"[PATCH] Make sure $PERL_PATH is defined when the test suite is run.","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2009-11-17T08:42:39Z","receivedAt":"2009-11-17T08:42:39Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"Some test scripts run Perl scripts as if they were git-* scripts, and\nthus need to use the same perl that will be put in the shebang line of\ngit*.perl commands. $PERL_PATH therefore needs to be used instead of\na bare \"perl\".\n\nThe tests can fail if another perl is found in $PATH before the one\ndefined in $PERL_PATH.\n\nExample test failure caused by this: the perl defined in $PERL_PATH has\nError.pm installed, and therefore the Git.pm's Makefile.PL doesn't install\nthe private copy. The perl from $PATH doesn't have Error.pm installed, and\nall git*.perl scripts invoked during the test will fail loading Error.pm.\n\nMakefile patch by Jeff King <peff@peff.net>.\n\nSigned-off-by: Philippe Bruhat (BooK) <book@cpan.org>\n---\n Makefile                        |    1 +\n t/t9400-git-cvsserver-server.sh |    2 +-\n t/t9401-git-cvsserver-crlf.sh   |    2 +-\n t/t9700-perl-git.sh             |    4 ++--\n 4 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 35f5294..287c7fc 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1633,6 +1633,7 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS\n # and the first level quoting from the shell that runs \"echo\".\n GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS\n \t@echo SHELL_PATH=\\''$(subst ','\\'',$(SHELL_PATH_SQ))'\\' >$@\n+\t@echo PERL_PATH=\\''$(subst ','\\'',$(PERL_PATH_SQ))'\\' >>$@\n \t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@\n \t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@\n \t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@\ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex 64f947d..c2ec3cb 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -20,7 +20,7 @@ then\n     say 'skipping git-cvsserver tests, cvs not found'\n     test_done\n fi\n-perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n+\"$PERL_PATH\" -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n     say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'\n     test_done\n }\ndiff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh\nindex aca40c1..40637d6 100755\n--- a/t/t9401-git-cvsserver-crlf.sh\n+++ b/t/t9401-git-cvsserver-crlf.sh\n@@ -57,7 +57,7 @@ then\n     say 'skipping git-cvsserver tests, perl not available'\n     test_done\n fi\n-perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n+\"$PERL_PATH\" -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {\n     say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'\n     test_done\n }\ndiff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh\nindex 4eb7d3f..8686086 100755\n--- a/t/t9700-perl-git.sh\n+++ b/t/t9700-perl-git.sh\n@@ -11,7 +11,7 @@ if ! test_have_prereq PERL; then\n \ttest_done\n fi\n \n-perl -MTest::More -e 0 2>/dev/null || {\n+\"$PERL_PATH\" -MTest::More -e 0 2>/dev/null || {\n \tsay \"Perl Test::More unavailable, skipping test\"\n \ttest_done\n }\n@@ -48,6 +48,6 @@ test_expect_success \\\n \n test_external_without_stderr \\\n     'Perl API' \\\n-    perl \"$TEST_DIRECTORY\"/t9700/test.pl\n+    \"$PERL_PATH\" \"$TEST_DIRECTORY\"/t9700/test.pl\n \n test_done\n-- \n1.6.0.3.517.g759a\n"},{"id":"127769","messageId":"7v6399f1qa.fsf@alter.siamese.dyndns.org","threadId":"21566","inReplyTo":"20091117083557.GC3608@plop","subject":"Re: [PATCH] Make sure $PERL_PATH is defined when the test suite is run.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-17T18:25:01Z","receivedAt":"2009-11-17T18:25:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philippe Bruhat (BooK)\" <book@cpan.org> writes:\n\n>> Make it: ... >>$@\n>\n> This proves late commits needs many extra pair of eyes. :-)\n> ...\n>> This one needs the double-quotes as well.\n>\n> Thanks. Sending again. (sorry for the noise)\n\nThanks, I also missed them. Will re-queue.\n"}]}