* Makefile.am (.in): Substitute @bindir@, not BINDIR, for
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 4 May 2007 19:53:25 +0000 (19:53 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 4 May 2007 19:53:25 +0000 (19:53 +0000)
consistency with other substitutions.
(check-local): Use --__bindir . rather than setting GZIP_BINDIR=.,
to allay security concerns voiced by Joerg Lehners in
<http://lists.gnu.org/archive/html/bug-gzip/2007-04/msg00003.html>.
* gunzip.in, gzexe.in, zcat.in, zcmp.in, zdiff.in, zegrep.in, zfgrep.in:
* zforce.in, zgrep.in, zless.in, zmore.in, znew.in:
Support --__bindir rather than GZIP_BINDIR.

* gunzip.in, zcat.in, zcmp.in: Support --help and --version
directly, to avoid some confusion in help and version output.
Problem reported by Eric Blake in
<http://lists.gnu.org/archive/html/bug-gzip/2007-04/msg00006.html>.

14 files changed:
ChangeLog
Makefile.am
gunzip.in
gzexe.in
zcat.in
zcmp.in
zdiff.in
zegrep.in
zfgrep.in
zforce.in
zgrep.in
zless.in
zmore.in
znew.in

index 4f2ea421522e3ef2b3f89ed090a4f1332f9dd812..063130ec66d671df9234af921628adf4abdcb8c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2007-05-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * Makefile.am (.in): Substitute @bindir@, not BINDIR, for
+       consistency with other substitutions.
+       (check-local): Use --__bindir . rather than setting GZIP_BINDIR=.,
+       to allay security concerns voiced by Joerg Lehners in
+       <http://lists.gnu.org/archive/html/bug-gzip/2007-04/msg00003.html>.
+       * gunzip.in, gzexe.in, zcat.in, zcmp.in, zdiff.in, zegrep.in, zfgrep.in:
+       * zforce.in, zgrep.in, zless.in, zmore.in, znew.in:
+       Support --__bindir rather than GZIP_BINDIR.
+
+       * gunzip.in, zcat.in, zcmp.in: Support --help and --version
+       directly, to avoid some confusion in help and version output.
+       Problem reported by Eric Blake in
+       <http://lists.gnu.org/archive/html/bug-gzip/2007-04/msg00006.html>.
+
 2007-04-28  Paul Eggert  <eggert@cs.ucla.edu>
 
        * m4/shell.m4 (AC_PROG_SHELL): Check for old-fashioned shells that
index 5799d753936e96c2a4d45e33e05286ae1179e560..3aceed6264818d59d5a6df4415b7573b6b3bec9c 100644 (file)
@@ -56,7 +56,7 @@ SUFFIXES = .in
 .in:
        sed \
                -e 's|/bin/sh|$(SHELL)|g' \
-               -e 's|BINDIR|$${GZIP_BINDIR-'\''$(bindir)'\''}|g' \
+               -e 's|[@]bindir@|'\''$(bindir)'\''|g' \
                -e 's|[@]VERSION@|$(VERSION)|g' \
                $(srcdir)/$@.in >$@
        chmod a+x $@
@@ -65,12 +65,12 @@ SUFFIXES = .in
 FILES_TO_CHECK = $(bin_SCRIPTS) $(gzip_LDADD) \
   $(top_srcdir)/ChangeLog $(top_srcdir)/configure $(top_srcdir)/gzip.c
 check-local: $(FILES_TO_CHECK) gzip.doc.gz
-       { test '$(srcdir)' != . || GZIP_BINDIR=. ./zdiff -c gzip.doc.gz; }
-       GZIP_BINDIR=. ./zdiff -c $(srcdir)/gzip.doc $(srcdir)/gzip.doc
-       GZIP_BINDIR=. ./zdiff $(srcdir)/gzip.doc gzip.doc.gz
-       GZIP_BINDIR=. ./zdiff -c - $(srcdir)/gzip.doc <gzip.doc.gz
-       GZIP_BINDIR=. ./zdiff -c gzip.doc.gz gzip.doc.gz
-       GZIP_BINDIR=. ./zgrep -iV >/dev/null
+       { test '$(srcdir)' != . || ./zdiff --__bindir . -c gzip.doc.gz; }
+       ./zdiff --__bindir . -c $(srcdir)/gzip.doc $(srcdir)/gzip.doc
+       ./zdiff --__bindir . $(srcdir)/gzip.doc gzip.doc.gz
+       ./zdiff --__bindir . -c - $(srcdir)/gzip.doc <gzip.doc.gz
+       ./zdiff --__bindir . -c gzip.doc.gz gzip.doc.gz
+       ./zgrep --__bindir . -iV >/dev/null
        for file in $(FILES_TO_CHECK); do \
          ./gzip -cv -- "$$file" | ./gzip -d | cmp - "$$file" || exit; \
        done
index 9490f16a5278a40355eb6fce1bc1e0f41997425f..52cf180de53b2e0759193b4b93226092c74d88f5 100644 (file)
--- a/gunzip.in
+++ b/gunzip.in
@@ -1,3 +1,61 @@
 #!/bin/sh
-PATH=BINDIR:$PATH
+# Uncompress files.  This is the inverse of gzip.
+
+# Copyright (C) 2007 Free Software Foundation
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH
+
+version="gunzip (gzip) @VERSION@
+Copyright (C) 2007 Free Software Foundation, Inc.
+This is free software.  You may redistribute copies of it under the terms of
+the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
+There is NO WARRANTY, to the extent permitted by law.
+
+Written by Paul Eggert."
+
+usage="Usage: $0 [OPTION]... [FILE]...
+Uncompress FILEs (by default, in-place).
+
+Mandatory arguments to long options are mandatory for short options too.
+
+  -c, --stdout      write on standard output, keep original files unchanged
+  -f, --force       force overwrite of output file and compress links
+  -l, --list        list compressed file contents
+  -n, --no-name     do not save or restore the original name and time stamp
+  -N, --name        save or restore the original name and time stamp
+  -q, --quiet       suppress all warnings
+  -r, --recursive   operate recursively on directories
+  -S, --suffix=SUF  use suffix SUF on compressed files
+  -t, --test        test compressed file integrity
+  -v, --verbose     verbose mode
+      --help        display this help and exit
+      --version     display version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Report bugs to <bug-gzip@gnu.org>."
+
+case $1 in
+--help)    exec echo "$usage";;
+--version) exec echo "$version";;
+esac
+
 exec gzip -d "$@"
index 0acd3bbb4deb8bfb3e3fae4265ecd26bb24ac420..281538df20304fe257cdcbbc525cff010d0a68f2 100644 (file)
--- a/gzexe.in
+++ b/gzexe.in
@@ -53,7 +53,11 @@ Rename each FILE with a compressed version of itself, renaming FILE to FILE~.
 Report bugs to <bug-gzip@gnu.org>."
 
 
-PATH="BINDIR:$PATH"
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH
 
 decomp=0
 res=0
diff --git a/zcat.in b/zcat.in
index 0ef85cf88e817c1f34b010b607d0846f27728c4a..4886ec44c129b4211d6d2b30ac085a4869d9d902 100644 (file)
--- a/zcat.in
+++ b/zcat.in
@@ -1,3 +1,56 @@
 #!/bin/sh
-PATH=BINDIR:$PATH
+# Uncompress files to standard output.
+
+# Copyright (C) 2007 Free Software Foundation
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH
+
+version="zcat (gzip) @VERSION@
+Copyright (C) 2007 Free Software Foundation, Inc.
+This is free software.  You may redistribute copies of it under the terms of
+the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
+There is NO WARRANTY, to the extent permitted by law.
+
+Written by Paul Eggert."
+
+usage="Usage: $0 [OPTION]... [FILE]...
+Uncompress FILEs to standard output.
+
+  -f, --force       force; read compressed data even from a terminal
+  -l, --list        list compressed file contents
+  -q, --quiet       suppress all warnings
+  -r, --recursive   operate recursively on directories
+  -S, --suffix=SUF  use suffix SUF on compressed files
+  -t, --test        test compressed file integrity
+  -v, --verbose     verbose mode
+      --help        display this help and exit
+      --version     display version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Report bugs to <bug-gzip@gnu.org>."
+
+case $1 in
+--help)    exec echo "$usage";;
+--version) exec echo "$version";;
+esac
+
 exec gzip -cd "$@"
diff --git a/zcmp.in b/zcmp.in
index 23284ff136f0e7717f68a14cb0c729cca295afb4..4747593c8bbf8c42a708f4a7331b3dada2805e8e 100644 (file)
--- a/zcmp.in
+++ b/zcmp.in
@@ -1,3 +1,50 @@
 #!/bin/sh
-PATH=BINDIR:$PATH
+# Compare the uncompressed contents of compressed files, byte by byte.
+
+# Copyright (C) 2007 Free Software Foundation
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH
+
+version="zcmp (gzip) @VERSION@
+Copyright (C) 2007 Free Software Foundation, Inc.
+This is free software.  You may redistribute copies of it under the terms of
+the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
+There is NO WARRANTY, to the extent permitted by law.
+
+Written by Paul Eggert."
+
+usage="Usage: $0 [OPTION]... FILE1 [FILE2]
+Compare FILE1 to FILE2 byte by byte, using their uncompressed contents
+if they are compressed.  If FILE2 is omitted, compare FILE1 to the
+uncompressed contents of FILE1.gz.  Do comparisons like 'cmp' does.
+
+Options are the same as for 'cmp'.
+
+If a FILE is '-' or missing, read standard input.
+
+Report bugs to <bug-gzip@gnu.org>."
+
+case $1 in
+--help)    exec echo "$usage";;
+--version) exec echo "$version";;
+esac
+
 exec zdiff --__cmp "$@"
index fda3259fe1a808d18d40e00e5337fc6b2aeebe55..22452099e8c1b43b902a5c3c64382013699ca119 100644 (file)
--- a/zdiff.in
+++ b/zdiff.in
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-PATH=BINDIR:$PATH
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH
 
 case $1 in
   --__cmp) shift
index 620b8cb6d72af8b4af0f8c67d411fa2b88ff0f37..800210f48fa5fd435a6eddc3937c3c28005f5312 100644 (file)
--- a/zegrep.in
+++ b/zegrep.in
@@ -1,3 +1,7 @@
 #!/bin/sh
-PATH=BINDIR:$PATH
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH
 exec zgrep -E "$@"
index 796236452cdae2f4729c34262168c518fa510528..c458d96c00a9da37848ed19c88ea791a0daaa6a9 100644 (file)
--- a/zfgrep.in
+++ b/zfgrep.in
@@ -1,3 +1,7 @@
 #!/bin/sh
-PATH=BINDIR:$PATH
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH
 exec zgrep -F "$@"
index b1a995eb1f5229ac8e7d50bffea61647563cfebb..c7f9ba212f4fd17c0e1cb4cd9439c12e4e81f7be 100644 (file)
--- a/zforce.in
+++ b/zforce.in
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-PATH="BINDIR:$PATH"; export PATH
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH; export PATH
 
 version="zforce (gzip) @VERSION@
 Copyright (C) 2007 Free Software Foundation, Inc.
index 8350d92ab9451e62286378db89cf83cb3a8fc322..9e1ece29321a1a59dd58c11f1ce357e4a5e5867d 100644 (file)
--- a/zgrep.in
+++ b/zgrep.in
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-PATH=BINDIR:$PATH
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH
+
 grep='${GREP-grep}'
 
 version='zgrep (gzip) @VERSION@
index 52352cb09f45482756e7644aae3443bf6d075552..7325434205232d8adab1b77a05d30a4d5e48b912 100644 (file)
--- a/zless.in
+++ b/zless.in
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-PATH="BINDIR:$PATH"; export PATH
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH; export PATH
 
 version="zless (gzip) @VERSION@
 Copyright (C) 2007 Free Software Foundation, Inc.
index 8ed26ae97c78770c93d77cec5d46f09778b0cdf0..5194f8fe8e30c0f2708a0faa241ce8f11d2119ee 100644 (file)
--- a/zmore.in
+++ b/zmore.in
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-PATH="BINDIR:$PATH"; export PATH
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH; export PATH
 
 version="zmore (gzip) @VERSION@
 Copyright (C) 2007 Free Software Foundation, Inc.
diff --git a/znew.in b/znew.in
index 97faa0402abf6f7d87487b066ca55009fab1799e..cc2a05c0111f275bf60c71c9607417a5fb762583 100644 (file)
--- a/znew.in
+++ b/znew.in
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-PATH="BINDIR:$PATH"; export PATH
+bindir=@bindir@
+case $1 in
+--__bindir) bindir=${2?}; shift; shift;;
+esac
+PATH=$bindir:$PATH; export PATH
 
 version="znew (gzip) @VERSION@
 Copyright (C) 2007 Free Software Foundation, Inc.