# [PATCH] test-lib: on FreeBSD, look for unzip(1) in /usr/local/bin/

5 messages from 2016-07-21 to 2017-01-27. Participants: Johannes Schindelin, Eric Wong, Junio C Hamano.
Thread: https://gitlist.dev/t/42901

## Johannes Schindelin, 2016-07-21 16:02

Subject: [PATCH] test-lib: on FreeBSD, look for unzip(1) in /usr/local/bin/
Message-ID: <31dce0b28ae094c976890c1604c4ebbcaef0e7ef.1469116960.git.johannes.schindelin@gmx.de>
URL: https://gitlist.dev/e/31dce0b28ae094c976890c1604c4ebbcaef0e7ef.1469116960.git.johannes.schindelin%40gmx.de

```
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>

Eric Wong reported that while FreeBSD has a /usr/bin/unzip, it uses
different semantics from those that are needed by Git's tests: When
passing the -a option to Info-Zip, it heeds the text attribute of the
.zip file's central directory, while FreeBSD's unzip ignores that
attribute.

The common work-around is to install Info-Zip on FreeBSD, into
/usr/local/bin/.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Published-As: https://github.com/dscho/git/releases/tag/freebsd-unzip-v1
 t/test-lib.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 11201e9..dd2f70c 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
-- 
2.9.0.281.g286a8d9

base-commit: 29493589e97a2de0c4c1c314f61ccafaee3b5caf

```

## Eric Wong, 2016-07-21 17:10

Subject: Re: [PATCH] test-lib: on FreeBSD, look for unzip(1) in /usr/local/bin/
Message-ID: <20160721171025.GA30979@plume>
URL: https://gitlist.dev/e/20160721171025.GA30979%40plume
In-Reply-To: <31dce0b28ae094c976890c1604c4ebbcaef0e7ef.1469116960.git.johannes.schindelin@gmx.de>

```
Johannes Schindelin <johannes.schindelin@gmx.de> wrote:
> The common work-around is to install Info-Zip on FreeBSD, into
> /usr/local/bin/.
> 
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Thanks, t5003 now works out-of-the-box.
Tested with Info-ZIP unzip installed and uninstalled.

Tested-by: Eric Wong <e@80x24.org>

```

## Johannes Schindelin, 2017-01-27 14:03

Subject: Re: [PATCH] test-lib: on FreeBSD, look for unzip(1) in /usr/local/bin/
Message-ID: <alpine.DEB.2.20.1701271502420.3469@virtualbox>
URL: https://gitlist.dev/e/alpine.DEB.2.20.1701271502420.3469%40virtualbox
In-Reply-To: <20160721171025.GA30979@plume>

```
Hi Junio,

On Thu, 21 Jul 2016, Eric Wong wrote:

> Johannes Schindelin <johannes.schindelin@gmx.de> wrote:
> > The common work-around is to install Info-Zip on FreeBSD, into
> > /usr/local/bin/.
> > 
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> 
> Thanks, t5003 now works out-of-the-box.
> Tested with Info-ZIP unzip installed and uninstalled.
> 
> Tested-by: Eric Wong <e@80x24.org>

Did you forget about this?

Ciao,
Johannes

```

## Junio C Hamano, 2017-01-27 18:44

Subject: Re: [PATCH] test-lib: on FreeBSD, look for unzip(1) in /usr/local/bin/
Message-ID: <xmqq8tpwz6jp.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqq8tpwz6jp.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <alpine.DEB.2.20.1701271502420.3469@virtualbox>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi Junio,
>
> On Thu, 21 Jul 2016, Eric Wong wrote:
>
>> Johannes Schindelin <johannes.schindelin@gmx.de> wrote:
>> > The common work-around is to install Info-Zip on FreeBSD, into
>> > /usr/local/bin/.
>> > 
>> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>> 
>> Thanks, t5003 now works out-of-the-box.
>> Tested with Info-ZIP unzip installed and uninstalled.
>> 
>> Tested-by: Eric Wong <e@80x24.org>
>
> Did you forget about this?

This fell off the radar.  

You could have resent with Eric's Tested-by: added, to make it
easier to apply.  I'll see if I can find the original but it won't
happen until later this afternoon.

```

## Junio C Hamano, 2017-01-27 20:47

Subject: Re: [PATCH] test-lib: on FreeBSD, look for unzip(1) in /usr/local/bin/
Message-ID: <xmqqvat0xmae.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqvat0xmae.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <xmqq8tpwz6jp.fsf@gitster.mtv.corp.google.com>

```
Junio C Hamano <gitster@pobox.com> writes:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> On Thu, 21 Jul 2016, Eric Wong wrote:
>>
>>> Thanks, t5003 now works out-of-the-box.
>>> Tested with Info-ZIP unzip installed and uninstalled.
>>> 
>>> Tested-by: Eric Wong <e@80x24.org>
>>
>> Did you forget about this?
>
> This fell off the radar.  
>
> You could have resent with Eric's Tested-by: added, to make it
> easier to apply.  I'll see if I can find the original but it won't
> happen until later this afternoon.

The errand I needed to run earlier in the day turned out to be not
so time consuming---I found the exchange and the patch is now
queued, and will be part of today's pushout.

Thanks, both.

```
