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

[PATCH] t9020: use configured Python to run test helper

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 19, 2012, 04:49 UTC
Message-ID
<7vip7yd4u2.fsf@alter.siamese.dyndns.org>

The test helper svnrdump_sim.py is used as "svnrdump" during the execution of this test, but the arrangement had a few undesirable things:

 - it relied on symbolic links;
 - unportable "export VAR=VAL" was used;
 - GIT_BUILD_DIR variable was not quoted correctly;
 - it assumed that the Python interpreter is in /usr/bin/ and
   called "python" (i.e. not "python2.7" etc.)

Rework this by writing a small shell script that spawns the right Python interpreter, using the right quoting.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * The analysis above counts more bugs than the number of lines that
   are deleted in this section of the code...
 t/t9020-remote-svn.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/t/t9020-remote-svn.sh b/t/t9020-remote-svn.sh
index 4f2dfe0..d7be66a 100755
--- a/t/t9020-remote-svn.sh
+++ b/t/t9020-remote-svn.sh
@@ -12,9 +12,13 @@ then
 	test_done
 fi
 
-# We override svnrdump by placing a symlink to the svnrdump-emulator in .
-export PATH="$HOME:$PATH"
-ln -sf $GIT_BUILD_DIR/contrib/svn-fe/svnrdump_sim.py "$HOME/svnrdump"
+# Override svnrdump with our simulator
+PATH="$HOME:$PATH"
+export PATH PYTHON_PATH GIT_BUILD_DIR
+
+write_script "$HOME/svnrdump" <<\EOF
+exec "$PYTHON_PATH" "$GIT_BUILD_DIR/contrib/svn-fe/svnrdump_sim.py" "$@"
+EOF
 
 init_git () {
 	rm -fr .git &&
-- 
1.8.1.rc2.196.g90926c8
Next: Pete Wyckoff
Message 1 of 2 in “t9020: use configured Python to run test helper”
  1. t9020: use configured Python to run test helperJunio C Hamano, Dec 19, 2012
  2. Pete WyckoffDec 19, 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.