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

[PATCH] test-lib.sh: set PERL5LIB instead of GITPERLLIB

From
LWLea Wiemann <lewiemann@gmail.com>
Date
Jun 1, 2008, 22:16 UTC
Message-ID
<1212358587-15948-1-git-send-email-LeWiemann@gmail.com>
In-Reply-To
<7vy75oalh7.fsf@gitster.siamese.dyndns.org>

By setting PERL5LIB for the tests, we enable Perl test scripts to just say "use Git;" without adding the GITPERLLIB paths to @INC beforehand.

Signed-off-by: Lea Wiemann <LeWiemann@gmail.com>
---
Junio C Hamano wrote:
> Lea Wiemann <lewiemann@gmail.com> writes:
>> How about [setting PERL5LIB in] test-lib.sh?
> 
> Sure, I think that would be sensible.

Actually, GITPERLLIB becomes redundant in that case, so I've simply replaced it with PERL5LIB in test-lib.sh.

I've tested the patch: all scripts pick up the right Git.pm, and all tests still pass. It also preserves existing PERL5LIB variables correctly.

Btw, I'm assuming that it's OK to post small patches (like this one) as replies. If you or anyone else would prefer independent patches to always start a new thread, please let me know.

-- Lea
 t/test-lib.sh |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 99b63da..2f86831 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -454,8 +454,9 @@ GIT_CONFIG_NOSYSTEM=1
 GIT_CONFIG_NOGLOBAL=1
 export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL
 
-GITPERLLIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
-export GITPERLLIB
+test -n "$PERL5LIB" && PERL5LIB=":$PERL5LIB"
+PERL5LIB="$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git$PERL5LIB"
+export PERL5LIB
 test -d ../templates/blt || {
 	error "You haven't built things yet, have you?"
 }
-- 
1.5.5.GIT
Previous: Junio C HamanoNext: Junio C Hamano
Message 16 of 23 in “gitweb: use Git.pm, and use its parse_rev method for git_get_head_hash”
  1. gitweb: use Git.pm, and use its parse_rev method for git_get_head_hashLea Wiemann, May 30, 2008
  2. Lea WiemannMay 30, 2008
  3. Jakub NarebskiMay 31, 2008
  4. Lea WiemannMay 31, 2008
  5. Jakub NarebskiJun 1, 2008
  6. Junio C HamanoJun 2, 2008
  7. Petr BaudisJun 2, 2008
  8. Jakub NarebskiJun 2, 2008
  9. Lea WiemannJun 2, 2008
  10. Petr BaudisMay 31, 2008
  11. gitweb: use Git.pm, and use its parse_rev method for git_get_head_hashLea Wiemann, May 31, 2008
  12. Lea WiemannMay 31, 2008
  13. Junio C HamanoJun 1, 2008
  14. Lea WiemannJun 1, 2008
  15. Junio C HamanoJun 1, 2008
  16. test-lib.sh: set PERL5LIB instead of GITPERLLIBLea Wiemann, Jun 1, 2008
  17. Junio C HamanoJun 2, 2008
  18. Lea WiemannJun 2, 2008
  19. test-lib.sh: set PERL5LIB instead of GITPERLLIBLea Wiemann, Jun 2, 2008
  20. Junio C HamanoJun 2, 2008
  21. Lea WiemannJun 2, 2008
  22. Lea WiemannJun 3, 2008
  23. Lea WiemannJun 1, 2008

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.