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

t5501-old-fetch-and-upload.sh fails with NO_PYTHON=1

From
DSDennis Stosberg <dennis@stosberg.net>
Date
Apr 11, 2006, 17:05 UTC
Message-ID
<20060411170508.G14ba7e47@leonov.stosberg.net>
Hello,

t/t5501-old-fetch-and-upload.sh fails on Solaris 9 with NO_PYTHON=1. The test doesn't work correctly on Linux with NO_PYTHON=1, too, but it doesn't cause a failure there.

When NO_PYTHON=1 is set, t/Makefile passes "--no-python" to the test as an argument. That causes the $list variable to be set to "--no-python" instead of "fetch upload". Since that string does not identify a program to be tested, $pgm remains unset.

On Linux the return code of "which $pgm" is 1 in that case, which causes the test to do nothing and exit without failure. In contrast, the return code of "which" without any argument is 0 on Solaris, so the test is being run and fails.

I have attached a simple fix, but is this test still useful at all?

Regards, Dennis

diff --git a/t/t5501-old-fetch-and-upload.sh b/t/t5501-old-fetch-and-upload.sh
index 596c88b..df69d97 100755
--- a/t/t5501-old-fetch-and-upload.sh
+++ b/t/t5501-old-fetch-and-upload.sh
@@ -13,10 +13,11 @@ tmp=`pwd`/.tmp$$
 
 retval=0
 
-if [ -z "$1" ]; then
+tests=`echo "$@"| sed -e 's/--[a-zA-Z\-]*//g'`
+if [ -z "$tests" ]; then
 	list="fetch upload"
 else
-	list="$@"
+	list="$tests"
 fi
 
 for i in $list; do
Next: Junio C Hamano
Message 1 of 3 in “t5501-old-fetch-and-upload.sh fails with NO_PYTHON=1”
  1. Dennis StosbergApr 11, 2006
  2. Junio C HamanoApr 11, 2006
  3. Johannes SchindelinApr 11, 2006

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.