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

5 messages from 2009-08-27 to 2009-08-27. Participants: Brandon Casey, Johan Herland, Junio C Hamano.
Thread: https://gitlist.dev/t/20758

## Brandon Casey, 2009-08-27 16:24

Subject: [PATCH jh/cvs-helper 0/2] Fix building when python is not available
Message-ID: <Rxz2NOwzg1UZ0TgAtOhrA7e8wE02XwcSzNC9cc1EL_W_oN1BjtZn8ClmG5zKB_DKmTgVP0PlMYI@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/Rxz2NOwzg1UZ0TgAtOhrA7e8wE02XwcSzNC9cc1EL_W_oN1BjtZn8ClmG5zKB_DKmTgVP0PlMYI%40cipher.nrlssc.navy.mil

```
These two are built on top of pu.  I'm pretty sure jh/cvs-helper is
the relevant branch.

Brandon Casey (2):
  Makefile: write NO_PYTHON setting to GIT-BUILD-OPTIONS file
  t/test-lib.sh: don't perform python preparations when NO_PYTHON is
    set

 Makefile      |    1 +
 t/test-lib.sh |   18 +++++++++---------
 2 files changed, 10 insertions(+), 9 deletions(-)

```

## Brandon Casey, 2009-08-27 16:24

Subject: [PATCH jh/cvs-helper 1/2] Makefile: write NO_PYTHON setting to GIT-BUILD-OPTIONS file
Message-ID: <Rxz2NOwzg1UZ0TgAtOhrA7dGx1obNszSQLoUJ4IoUGJk5ekFKeKU4vpg535nyOx20P_IWNiudJo@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/Rxz2NOwzg1UZ0TgAtOhrA7dGx1obNszSQLoUJ4IoUGJk5ekFKeKU4vpg535nyOx20P_IWNiudJo%40cipher.nrlssc.navy.mil
In-Reply-To: <Rxz2NOwzg1UZ0TgAtOhrA7e8wE02XwcSzNC9cc1EL_W_oN1BjtZn8ClmG5zKB_DKmTgVP0PlMYI@cipher.nrlssc.navy.mil>

```
From: Brandon Casey <drafnel@gmail.com>

The GIT-BUILD-OPTIONS file is sourced by the t/test-lib.sh script which
prepares the environment for the test suite.  It is used to communicate
the user's settings for things like SHELL_PATH, TAR, NO_CURL, and NO_PERL.
Add NO_PYTHON so this setting will be available to the test suite.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 128c308..5c1ae7b 100644
--- a/Makefile
+++ b/Makefile
@@ -1615,6 +1615,7 @@ GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS
 	@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
 	@echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
 	@echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
+	@echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@
 
 ### Detect Tck/Tk interpreter path changes
 ifndef NO_TCLTK
-- 
1.6.4

```

## Brandon Casey, 2009-08-27 16:24

Subject: [PATCH jh/cvs-helper 2/2] t/test-lib.sh: don't perform python preparations when NO_PYTHON is set
Message-ID: <Rxz2NOwzg1UZ0TgAtOhrAzUAMAnO9FMOUVyBSREU0jlWw8GgmyUyfh_Kw3hSgy17_1U6jTxx7pE@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/Rxz2NOwzg1UZ0TgAtOhrAzUAMAnO9FMOUVyBSREU0jlWw8GgmyUyfh_Kw3hSgy17_1U6jTxx7pE%40cipher.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

```

## Johan Herland, 2009-08-27 16:57

Subject: Re: [PATCH jh/cvs-helper 0/2] Fix building when python is not available
Message-ID: <200908271857.47035.johan@herland.net>
URL: https://gitlist.dev/e/200908271857.47035.johan%40herland.net
In-Reply-To: <Rxz2NOwzg1UZ0TgAtOhrA7e8wE02XwcSzNC9cc1EL_W_oN1BjtZn8ClmG5zKB_DKmTgVP0PlMYI@cipher.nrlssc.navy.mil>

```
On Thursday 27 August 2009, Brandon Casey wrote:
> These two are built on top of pu.  I'm pretty sure jh/cvs-helper is
> the relevant branch.
>
> Brandon Casey (2):
>   Makefile: write NO_PYTHON setting to GIT-BUILD-OPTIONS file
>   t/test-lib.sh: don't perform python preparations when NO_PYTHON is
>     set

Thanks. Both are

Acked-by: Johan Herland <johan@herland.net>

I'll fold these into the next iteration of jh/cvs-helper.


Have fun! :)

...Johan


-- 
Johan Herland, <johan@herland.net>
www.herland.net

```

## Junio C Hamano, 2009-08-27 21:46

Subject: Re: [PATCH jh/cvs-helper 0/2] Fix building when python is not available
Message-ID: <7v3a7dorq2.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v3a7dorq2.fsf%40alter.siamese.dyndns.org
In-Reply-To: <200908271857.47035.johan@herland.net>

```
Johan Herland <johan@herland.net> writes:

> Thanks. Both are
>
> Acked-by: Johan Herland <johan@herland.net>
>
> I'll fold these into the next iteration of jh/cvs-helper.

Thanks, both.  Then I'll ignore this thread and simply wait for the next
round from you.

```
