From: Johannes Schindelin <Johannes.Schindelin@gmx•de>
To: Jeff King <peff@peff•net>
Cc: "Eric Wong" <e@80x24•org>, "Junio C Hamano" <gitster@pobox•com>,
"René Scharfe" <l.s.r@web•de>,
git@vger•kernel.org
Subject: Re: [PATCH] test-lib: stricter unzip(1) check
Date: Mon, 18 Jul 2016 15:52:31 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1607181536540.3472@virtualbox> (raw)
In-Reply-To: <20160718130405.GA19751@sigill.intra.peff.net>
Hi Peff & Eric,
On Mon, 18 Jul 2016, Jeff King wrote:
> On Mon, Jul 18, 2016 at 06:44:31AM +0000, Eric Wong wrote:
>
> > On FreeBSD 10.3 (but presumably any FreeBSD 8+), /usr/bin/unzip
> > exists, but is insufficient for t5003 due to its non-standard
> > handling of the -a option[1]. This version of unzip exits
> > with "1" when given the "-v" flag.
> >
> > However, the common Info-ZIP version may be installed at
> > /usr/local/bin/unzip (via "pkg install unzip") to pass t5003.
> > This Info-ZIP version exits with "0" when given "-v",
> > so limit the prereq to only versions which return 0 on "-v".
Hrm. That sounds a little magical, and fragile, to me. What if the next
person's unzip returns 0 and *still* cannot handle -a?
I'd rather do something like
-- snipsnap --
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0055ebb..5b9521e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -929,7 +929,8 @@ yes () {
}
# Fix some commands on Windows
-case $(uname -s) in
+uname_s=$(uname -s)
+case $uname_s in
*MINGW*)
# Windows has its own (incompatible) sort and find
sort () {
@@ -1100,6 +1101,7 @@ test_lazy_prereq SANITY '
return $status
'
+test FreeBSD != $uname_s || GIT_UNZIP=${GIT_UNZIP:-/usr/local/bin/unzip}
GIT_UNZIP=${GIT_UNZIP:-unzip}
test_lazy_prereq UNZIP '
"$GIT_UNZIP" -v
next prev parent reply other threads:[~2016-07-18 13:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-18 6:44 [PATCH] test-lib: stricter unzip(1) check Eric Wong
2016-07-18 13:04 ` Jeff King
2016-07-18 13:52 ` Johannes Schindelin [this message]
2016-07-18 18:20 ` Junio C Hamano
2016-07-18 18:56 ` Jeff King
2016-07-18 19:17 ` Junio C Hamano
2016-07-19 11:27 ` Johannes Schindelin
2016-07-19 17:26 ` Junio C Hamano
2016-07-18 19:43 ` Junio C Hamano
2016-07-18 20:03 ` Eric Wong
2016-07-18 20:19 ` Junio C Hamano
2016-07-18 21:19 ` Eric Wong
2016-07-18 21:27 ` Junio C Hamano
2016-07-18 23:41 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1607181536540.3472@virtualbox \
--to=johannes.schindelin@gmx$(echo .)de \
--cc=e@80x24$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=l.s.r@web$(echo .)de \
--cc=peff@peff$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox