git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitweb-lib.sh: Set up PATH to use perl from /usr/bin

From
Torsten Bögershausen <tboegi@web.de>
Date
May 1, 2012, 11:23 UTC
Message-ID
<201205011323.45190.tboegi@web.de>

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
Next: Zbigniew Jędrzejewski-Szmek
Message 1 of 12 in “gitweb-lib.sh: Set up PATH to use perl from /usr/bin”
  1. gitweb-lib.sh: Set up PATH to use perl from /usr/binTorsten Bögershausen, May 1, 2012
  2. Zbigniew Jędrzejewski-SzmekMay 1, 2012
  3. Jeff KingMay 1, 2012
  4. Junio C HamanoMay 1, 2012
  5. Zbigniew Jędrzejewski-SzmekMay 1, 2012
  6. Jeff KingMay 1, 2012
  7. Torsten BögershausenMay 1, 2012
  8. Junio C HamanoMay 1, 2012
  9. t/gitweb-lib: use $PERL_PATH to run gitwebJeff King, May 1, 2012
  10. Consistently use perl from /usr/bin/ for scriptsZbigniew Jędrzejewski-Szmek, May 1, 2012
  11. Randal L. SchwartzMay 1, 2012
  12. Junio C HamanoMay 1, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.