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

[PATCH jh/cvs-helper 2/2] t/test-lib.sh: don't perform python preparations when NO_PYTHON is set

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Aug 27, 2009, 16:24 UTC
Message-ID
<Rxz2NOwzg1UZ0TgAtOhrAzUAMAnO9FMOUVyBSREU0jlWw8GgmyUyfh_Kw3hSgy17_1U6jTxx7pE@cipher.nrlssc.navy.mil>
In-Reply-To
<Rxz2NOwzg1UZ0TgAtOhrA7dGx1obNszSQLoUJ4IoUGJk5ekFKeKU4vpg535nyOx20P_IWNiudJo@cipher.nrlssc.navy.mil>
From: Brandon Casey <drafnel@gmail.com>

When setting GITPYTHONLIB, a check is performed to test whether the path that GITPYTHONLIB is set to is a valid directory. This test always fails when NO_PYTHON is set since git_remote_cvs is not built. So add a test on NO_PYTHON to the conditional that protects this section.

Additionally, move this section down so it is done _after_ GIT-BUILD-OPTIONS is sourced, so that the NO_PYTHON setting is available.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/test-lib.sh |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a7fbfef..d95c66b 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -638,15 +638,6 @@ test -d ../templates/blt || {
 	error "You haven't built things yet, have you?"
 }
 
-if test -z "$GIT_TEST_INSTALLED"
-then
-	GITPYTHONLIB="$(pwd)/../git_remote_cvs/build/lib"
-	export GITPYTHONLIB
-	test -d ../git_remote_cvs/build || {
-		error "You haven't built git_remote_cvs yet, have you?"
-	}
-fi
-
 if ! test -x ../test-chmtime; then
 	echo >&2 'You need to build test-chmtime:'
 	echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
@@ -655,6 +646,15 @@ fi
 
 . ../GIT-BUILD-OPTIONS
 
+if test -z "$NO_PYTHON" -a -z "$GIT_TEST_INSTALLED"
+then
+	GITPYTHONLIB="$(pwd)/../git_remote_cvs/build/lib"
+	export GITPYTHONLIB
+	test -d ../git_remote_cvs/build || {
+		error "You haven't built git_remote_cvs yet, have you?"
+	}
+fi
+
 # Test repository
 test="trash directory.$(basename "$0" .sh)"
 test -n "$root" && test="$root/$test"
-- 
1.6.4
Previous: Brandon CaseyNext: Johan Herland
Message 3 of 5 in “Fix building when python is not available”
  1. 0/2 Fix building when python is not availableBrandon Casey, Aug 27, 2009
  2. 1/2 Makefile: write NO_PYTHON setting to GIT-BUILD-OPTIONS fileBrandon Casey, Aug 27, 2009
  3. 2/2 t/test-lib.sh: don't perform python preparations when NO_PYTHON is setBrandon Casey, Aug 27, 2009
  4. Johan HerlandAug 27, 2009
  5. Junio C HamanoAug 27, 2009

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.