git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: jnareb@gmail.com, git@vger.kernel.org
Cc: tboegi@web.de
Subject: [PATCH] gitweb-lib.sh: Set up PATH to use perl from /usr/bin
Date: Tue, 1 May 2012 13:23:44 +0200	[thread overview]
Message-ID: <201205011323.45190.tboegi@web.de> (raw)

When there are different version of perl installed on the machine,
the $PATH may point out a different version of perl than /usr/bin.
One example is to have /opt/local/bin/perl before /usr/bin/perl.

Sanitize the PATH by adding /usr/bin at the beginning

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
On my Mac OS machine t9501-gitweb-standalone-http-status.sh failed because
perl was found under /opt/local/bin instead of of /usr/bin.

/opt/local/bin is coming from Macports.
The problem with different perl installations on the same machine
may hit more people than just me.

There are different solutions, please help to find the best one:

a) Delete perl from /opt/local/bin
b) Put /opt/local/bin at the end of the PATH 
c) Change gitweb-lib.sh to set up the PATH to /usr/bin, because that is what the
file gitweb_config.perl generated by gitweb-lib.sh expects.


 t/gitweb-lib.sh |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index 21d11d6..a016142 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -113,4 +113,7 @@ perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {
 	test_done
 }
 
+PATH=/usr/bin/:$PATH
+export PATH
+
 gitweb_init
-- 
1.7.10.rc0.17.g74595.dirty

             reply	other threads:[~2012-05-01 11:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-01 11:23 Torsten Bögershausen [this message]
2012-05-01 16:23 ` [PATCH] gitweb-lib.sh: Set up PATH to use perl from /usr/bin Zbigniew Jędrzejewski-Szmek
2012-05-01 16:34   ` Jeff King
2012-05-01 16:47   ` Junio C Hamano
2012-05-01 17:03     ` Zbigniew Jędrzejewski-Szmek
2012-05-01 17:08       ` Jeff King
2012-05-01 17:50         ` Torsten Bögershausen
2012-05-01 17:53           ` Junio C Hamano
2012-05-01 17:55           ` [PATCH] t/gitweb-lib: use $PERL_PATH to run gitweb Jeff King
2012-05-01 20:18             ` [PATCH] Consistently use perl from /usr/bin/ for scripts Zbigniew Jędrzejewski-Szmek
2012-05-01 20:54               ` Randal L. Schwartz
2012-05-01 16:44 ` [PATCH] gitweb-lib.sh: Set up PATH to use perl from /usr/bin Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201205011323.45190.tboegi@web.de \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).