git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t5000: skip ZIP tets when unzip is absent
@ 2007-05-10 10:47 Johannes Schindelin
  2007-05-10 20:49 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2007-05-10 10:47 UTC (permalink / raw)
  To: junkio, git


Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

 t/t5000-tar-tree.sh |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index e223c07..1580592 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -108,6 +108,13 @@ test_expect_success \
     'git-archive --format=zip' \
     'git-archive --format=zip HEAD >d.zip'
 
+unzip -v 2>/dev/null
+if [ $? -ne 10 ]; 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)'

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] t5000: skip ZIP tets when unzip is absent
  2007-05-10 10:47 [PATCH] t5000: skip ZIP tets when unzip is absent Johannes Schindelin
@ 2007-05-10 20:49 ` Junio C Hamano
  2007-05-12 15:39   ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2007-05-10 20:49 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: junkio, git

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

> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
>
> ---
>
>  t/t5000-tar-tree.sh |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
> index e223c07..1580592 100755
> --- a/t/t5000-tar-tree.sh
> +++ b/t/t5000-tar-tree.sh
> @@ -108,6 +108,13 @@ test_expect_success \
>      'git-archive --format=zip' \
>      'git-archive --format=zip HEAD >d.zip'
>  
> +unzip -v 2>/dev/null
> +if [ $? -ne 10 ]; then
> +	echo "Skipping ZIP tests, because unzip was not found"
> +	test_done
> +	exit
> +fi
> +

Are you sure about this?

        $ unzip -v 2>/dev/null; echo "**$?**"
        UnZip 5.52 of 28 February 2005, by Debian. Original by Info-ZIP.

        Latest sources and executables are at
        ftp://ftp.info-zip.org/pub/infozip/ ;
        see ftp://ftp.info-zip.org/pub/infozip/UnZip.html for other
        sites.

        Compiled with gcc 4.1.2 20060814 (prerelease) (Debian 4.1.1-11)
        for Unix (Linux ELF) on Aug 30 2006.

        UnZip special compilation options:
                ACORN_FTYPE_NFS
                COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not
                supported)
                SET_DIR_ATTRIB
                TIMESTAMP
                USE_EF_UT_TIME
                USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method
                supported)
                USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)
                VMS_TEXT_CONV
                WILD_STOP_AT_DIR
                [decryption, version 2.9 of 05 May 2000]

        UnZip and ZipInfo environment options:
                   UNZIP:  [none]
                UNZIPOPT:  [none]
                 ZIPINFO:  [none]
              ZIPINFOOPT:  [none]
        **0**
	$ unzil -v 2>/dev/null; echo "**$?**"
	**127**

So two points are...

 * 2>/dev/null alone would give unsightly output to stdout which
   does not need to be in the test when unzip is available;

 * at least one version of unzip does not exit with status 10
   upon successful -v invocation, so the test is wrong; "unzip
   is unavaiable" is typically signalled with exit 127 (POSIX
   tells shell to use this for "command not found"; if found but
   not executable is 126).

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] t5000: skip ZIP tets when unzip is absent
  2007-05-10 20:49 ` Junio C Hamano
@ 2007-05-12 15:39   ` Johannes Schindelin
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2007-05-12 15:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi,

On Thu, 10 May 2007, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> >
> > ---
> >
> >  t/t5000-tar-tree.sh |    7 +++++++
> >  1 files changed, 7 insertions(+), 0 deletions(-)
> >
> > diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
> > index e223c07..1580592 100755
> > --- a/t/t5000-tar-tree.sh
> > +++ b/t/t5000-tar-tree.sh
> > @@ -108,6 +108,13 @@ test_expect_success \
> >      'git-archive --format=zip' \
> >      'git-archive --format=zip HEAD >d.zip'
> >  
> > +unzip -v 2>/dev/null
> > +if [ $? -ne 10 ]; then
> > +	echo "Skipping ZIP tests, because unzip was not found"
> > +	test_done
> > +	exit
> > +fi
> > +
> 
> Are you sure about this?

No longer.

At least one unzip version I tested returned exit code 10 when correctly 
showing the usage (IIRC). However, another one has exit code 0!

Also, it should not hardcode "unzip", but instead use "$UNZIP".

So, please ignore this patch. I try to do it properly.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-12 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-10 10:47 [PATCH] t5000: skip ZIP tets when unzip is absent Johannes Schindelin
2007-05-10 20:49 ` Junio C Hamano
2007-05-12 15:39   ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).