Skip to contentSkip to conversation

Git requires zip?

PATCH New Linus Torvalds 3 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

It really shouldn't, but "make test" seems very unhappy if the machine doesn't have it, and I don't see anything that disables the tests for that case..

Linus

#2 lore raw

PATCH 1/1 t5000: skip ZIP tests if unzip was not found

---

On Tue, 5 Jun 2007, Johannes Schindelin wrote:

> I seem to remember that I patched it already.
>
> http://thread.gmane.org/gmane.comp.version-control.git/46854/focus=46899
>
> Unfortunately, the patch was incorrect, and I forgot to do it > properly. Will try this afternoon.

So, took me some more time. Sorry.

 t/t5000-tar-tree.sh |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
t/t5000-tar-tree.sh +7 -0
index e223c07..5500505 100755
@@ -108,6 +108,13 @@ test_expect_success \
     'git-archive --format=zip' \
     'git-archive --format=zip HEAD >d.zip'
 
+$UNZIP -v 2>/dev/null
+if [ $? -eq 127 ]; then
+	echo "Skipping ZIP tests, because unzip was not found"
+	test_done
+	exit
+fi
+
 test_expect_success \
     'extract ZIP archive' \
     '(mkdir d && cd d && $UNZIP ../d.zip)'
#3 lore raw

PATCH 1/1 t5000: silence unzip availability check

unzip -v on (at least) Ubuntu prints a screenful of version info to stdout. Get rid of it since we only want to know if unzip is installed or not.

---

t/t5000-tar-tree.sh +1 -1
index 5500505..a6c5bf6 100755
@@ -108,7 +108,7 @@ test_expect_success \
     'git-archive --format=zip' \
     'git-archive --format=zip HEAD >d.zip'
 
-$UNZIP -v 2>/dev/null
+$UNZIP -v >/dev/null 2>&1
 if [ $? -eq 127 ]; then
 	echo "Skipping ZIP tests, because unzip was not found"
 	test_done
#4 lore raw

Re: [PATCH] t5000: silence unzip availability check

Hi,

Quoted 3 lines · René Scharfe

unzip -v on (at least) Ubuntu prints a screenful of version info to stdout. Get rid of it since we only want to know if unzip is installed or not.

Makes sense, absolutely.

ACK,
Dscho