bug-gzip
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gzip changes to support GNU standards for behavior, check gzip status


From: Paul Eggert
Subject: gzip changes to support GNU standards for behavior, check gzip status
Date: Mon, 05 Feb 2007 12:55:46 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

I installed this:

2007-02-05  Paul Eggert  <address@hidden>

        * gunzip.in, zcat.in, zcmp.in, zegrep.in, zfgrep.in: New files.
        * Makefile.am (EXTRA_DIST): Add them.
        (bin_SCRIPTS, MOSTLYCLEANFILES): Add gunzip, zcat, zcmp, zdgrep, zfgrep.
        (.in): Use GZIP_BINDIR as the location of gzip binaries, if it is set.
        (check-local): Use GZIP_BINDIR.
        (install-exec-hook, remove-installed-links): Make 'uncompress' an
        alias for gunzip.
        * gzexe.1: At least one arg is required.  Don't give cat as an
        example, since gzexe refuses to compress cat due to a bootstrapping
        issue.  List more utilities in this category.
        * gzexe.in, zdiff.in, zforce.in, zgrep.in, zless.in, zmore.in, znew.in:
        Report our name in usage.
        * gzexe.in: Don't compress bash.  Don't use rmdir, so it's
        OK to compress rmdir.
        * gzip.c: Now requires that you compile with -DGNU_STANDARD=0 to
        get non GNU-standard behavior.  We now build with GNU-standard
        behavior by default, so that programs do not depend on the names
        of their executables.
        * zdiff.in: Don't depend on the name of the executable, as per
        GNU standard.  Instead, rely on an internal --__cmp option.
        Support ' in options.  Check for failures in subsidiary gzip
        invocations.
        * zgrep.1: Clarify compression issues.
        * zgrep.in: Don't assume POSIX-style case syntax.  Remove unused var
        have_optarg.
        * zless.1: zless sets LESSMETACHARS now.

Index: gunzip.in
===================================================================
RCS file: gunzip.in
diff -N gunzip.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gunzip.in   5 Feb 2007 20:54:23 -0000
@@ -0,0 +1,3 @@
+#!/bin/sh
+PATH=BINDIR:$PATH
+exec gzip -d "$@"
Index: zcat.in
===================================================================
RCS file: zcat.in
diff -N zcat.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ zcat.in     5 Feb 2007 20:54:23 -0000
@@ -0,0 +1,3 @@
+#!/bin/sh
+PATH=BINDIR:$PATH
+exec gzip -cd "$@"
Index: zcmp.in
===================================================================
RCS file: zcmp.in
diff -N zcmp.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ zcmp.in     5 Feb 2007 20:54:23 -0000
@@ -0,0 +1,3 @@
+#!/bin/sh
+PATH=BINDIR:$PATH
+exec zdiff --__cmp "$@"
Index: zegrep.in
===================================================================
RCS file: zegrep.in
diff -N zegrep.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ zegrep.in   5 Feb 2007 20:54:23 -0000
@@ -0,0 +1,3 @@
+#!/bin/sh
+PATH=BINDIR:$PATH
+exec zgrep -E "$@"
Index: zfgrep.in
===================================================================
RCS file: zfgrep.in
diff -N zfgrep.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ zfgrep.in   5 Feb 2007 20:54:23 -0000
@@ -0,0 +1,3 @@
+#!/bin/sh
+PATH=BINDIR:$PATH
+exec zgrep -F "$@"
Index: Makefile.am
===================================================================
RCS file: /cvsroot/gzip/gzip/Makefile.am,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile.am
--- Makefile.am 31 Dec 2006 07:49:24 -0000      1.20
+++ Makefile.am 5 Feb 2007 20:54:23 -0000
@@ -1,6 +1,6 @@
 # Make gzip (GNU zip).

-# Copyright (C) 1999, 2001, 2002, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2006, 2007 Free Software Foundation, Inc.

 # 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
@@ -26,7 +26,7 @@ man_MANS = gunzip.1 gzexe.1 gzip.1 \
 EXTRA_DIST = $(ACINCLUDE_INPUTS) $(man_MANS) \
   algorithm.doc amiga/match.a amiga/Makefile.gcc amiga/Makefile.sasc \
   amiga/tailor.c amiga/utime.h atari/Makefile.st crypt.h \
-  gzexe.in gzip.doc gzip.h lzw.h msdos/match.asm msdos/tailor.c \
+  gunzip.in gzexe.in gzip.doc gzip.h lzw.h msdos/match.asm msdos/tailor.c \
   msdos/gzip.prj msdos/doturboc.bat msdos/Makefile.msc msdos/Makefile.bor \
   msdos/Makefile.djg nt/Makefile.nt os2/gzip.def os2/Makefile.os2 \
   os2/gzip16.def primos/include/errno.h primos/include/fcntl.h \
@@ -35,11 +35,12 @@ EXTRA_DIST = $(ACINCLUDE_INPUTS) $(man_M
   primos/primos.c primos/ci.opts revision.h sample/makecrc.c \
   sample/ztouch sample/add.c sample/sub.c sample/zread.c sample/zfile \
   tailor.h vms/Makefile.mms vms/gzip.hlp vms/vms.c vms/Readme.vms \
-  vms/Makefile.vms vms/Makefile.gcc vms/makegzip.com zdiff.in \
-  zforce.in zgrep.in zless.in zmore.in znew.in
+  vms/Makefile.vms vms/Makefile.gcc vms/makegzip.com zcat.in zcmp.in zdiff.in \
+  zegrep.in zfgrep.in zforce.in zgrep.in zless.in zmore.in znew.in

 bin_PROGRAMS = gzip
-bin_SCRIPTS = gzexe zdiff zgrep zforce zless zmore znew
+bin_SCRIPTS = gunzip gzexe zcat zcmp zdiff \
+  zegrep zfgrep zforce zgrep zless zmore znew
 gzip_SOURCES = \
   bits.c crypt.c deflate.c gzip.c inflate.c lzw.c \
   trees.c unlzh.c unlzw.c unpack.c unzip.c util.c zip.c
@@ -55,7 +56,7 @@ SUFFIXES = .in
 .in:
        sed \
                -e 's|/bin/sh|$(SHELL)|g' \
-               -e 's|BINDIR|$(bindir)|g' \
+               -e 's|BINDIR|$${GZIP_BINDIR-'\''$(bindir)'\''}|g' \
                -e 's|address@hidden@|$(VERSION)|g' \
                $(srcdir)/address@hidden >$@
        chmod a+x $@
@@ -64,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)' != . || ./zdiff -c gzip.doc.gz
-       ./zdiff -c $(srcdir)/gzip.doc $(srcdir)/gzip.doc
-       ./zdiff $(srcdir)/gzip.doc gzip.doc.gz
-       ./zdiff -c - $(srcdir)/gzip.doc <gzip.doc.gz
-       ./zdiff -c gzip.doc.gz gzip.doc.gz
-       ./zgrep -iV >/dev/null
+       { 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
        for file in $(FILES_TO_CHECK); do \
          ./gzip -cv -- "$$file" | ./gzip -d | cmp - "$$file" || exit; \
        done
@@ -80,9 +81,7 @@ install-exec-hook remove-installed-links
        @for prog_ext in $(bin_PROGRAMS) $(bin_SCRIPTS); do \
          prog=`echo "$$prog_ext"|sed 's/$(EXEEXT)$$//'`; \
          case $$prog in \
-         gzip) aliases='gunzip zcat';; \
-         zdiff) aliases='zcmp';; \
-         zgrep) aliases='zegrep zfgrep';; \
+         gunzip) aliases='uncompress';; \
          *) continue;; \
          esac; \
          transform='$(transform)'; \
@@ -108,4 +107,4 @@ uninstall-local: remove-installed-links
 MAINTAINERCLEANFILES = gzip.doc

 MOSTLYCLEANFILES = _match.i match_.s _match.S gzip.doc.gz \
-  gzexe zdiff zforce zgrep zless zmore znew
+  gunzip gzexe zcat zcmp zdiff zegrep zfgrep zforce zgrep zless zmore znew
Index: gzexe.1
===================================================================
RCS file: /cvsroot/gzip/gzip/gzexe.1,v
retrieving revision 1.1
diff -u -p -r1.1 gzexe.1
--- gzexe.1     16 Jun 1993 09:37:18 -0000      1.1
+++ gzexe.1     5 Feb 2007 20:54:23 -0000
@@ -3,22 +3,22 @@
 gzexe \- compress executable files in place
 .SH SYNOPSIS
 .B gzexe
-[ name ...  ]
+.I "name .\|.\|."
 .SH DESCRIPTION
 The
 .I  gzexe
 utility allows you to compress executables in place and have them
 automatically uncompress and execute when you run them (at a penalty
-in performance).  For example if you execute ``gzexe /bin/cat'' it
+in performance).  For example if you execute ``gzexe /usr/bin/gdb'' it
 will create the following two files:
 .nf
 .br
-    -r-xr-xr-x  1 root  bin   9644 Feb 11 11:16 /bin/cat
-    -r-xr-xr-x  1 bin   bin  24576 Nov 23 13:21 /bin/cat~
+    -rwxr-xr-x  1 root root 1026675 Jun  7 13:53 /usr/bin/gdb
+    -rwxr-xr-x  1 root root 2304524 May 30 13:02 /usr/bin/gdb~
 .fi
-/bin/cat~ is the original file and /bin/cat is the self-uncompressing
-executable file.  You can remove /bin/cat~ once you are sure that
-/bin/cat works properly.
+/usr/bin/gdb~ is the original file and /usr/bin/gdb is the self-uncompressing
+executable file.  You can remove /usr/bin/gdb~ once you are sure that
+/usr/bin/gdb works properly.
 .PP
 This utility is most useful on systems with very small disks.
 .SH OPTIONS
@@ -28,16 +28,24 @@ Decompress the given executables instead
 .SH "SEE ALSO"
 gzip(1), znew(1), zmore(1), zcmp(1), zforce(1)
 .SH CAVEATS
-The compressed executable is a shell script. This may create some
-security holes. In particular, the compressed executable relies
+The compressed executable is a shell script.  This may create some
+security holes.  In particular, the compressed executable relies
 on the PATH environment variable to find
 .I gzip
-and some other utilities
-.I (tail, chmod, ln, sleep).
+and some standard utilities
+.RI ( basename ,
+.IR chmod ,
+.IR ln ,
+.IR mkdir ,
+.IR mktemp ,
+.IR rm ,
+.IR sleep ,
+and
+.IR tail ).
 .SH "BUGS"
-.I gzexe 
+.I gzexe
 attempts to retain the original file attributes on the compressed executable,
 but you may have to fix them manually in some cases, using
 .I chmod
 or
-.I chown.
+.IR chown .
Index: gzexe.in
===================================================================
RCS file: /cvsroot/gzip/gzip/gzexe.in,v
retrieving revision 1.8
diff -u -p -r1.8 gzexe.in
--- gzexe.in    9 Dec 2006 06:58:27 -0000       1.8
+++ gzexe.in    5 Feb 2007 20:54:23 -0000
@@ -13,7 +13,7 @@
 # On Ultrix, /bin/sh is too buggy, change the first line to: #!/bin/sh5


-# Copyright (C) 1998, 2002, 2004, 2006 Free Software Foundation
+# Copyright (C) 1998, 2002, 2004, 2006, 2007 Free Software Foundation
 # Copyright (C) 1993 Jean-loup Gailly

 # This program is free software; you can redistribute it and/or modify
@@ -36,21 +36,21 @@ nl='
 IFS=" $tab$nl"

 version='gzexe (gzip) @VERSION@
-Copyright (C) 2006 Free Software Foundation, Inc.
+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 Jean-loup Gailly.'

-usage='Usage: gzexe [OPTION] FILE...
+usage="Usage: $0 [OPTION] FILE...
 Rename each FILE with a compressed version of itself, renaming FILE to FILE~.

   -d             Decompress each FILE instead of compressing it.
       --help     display this help and exit
       --version  output version information and exit

-Report bugs to <address@hidden>.'
+Report bugs to <address@hidden>."


 PATH="BINDIR:$PATH"
@@ -106,11 +106,11 @@ for i do
     continue
   fi
   case /$file in
-  */basename | */cat | */chmod | */cp | \
+  */basename | */bash | */cat | */chmod | */cp | \
   */dirname | */echo | */expr | */gzip | \
-  */ln | */mkdir | */mktemp | */mv | */rm | */rmdir | \
+  */ln | */mkdir | */mktemp | */mv | */rm | \
   */sed | */sh | */sleep | */test | */tail)
-    echo >&2 "$0: $i would depend on itself"; continue;;
+    echo >&2 "$0: $i might depend on itself"; continue;;
   esac

   dir=`dirname "$file"` || dir=$TMPDIR
@@ -167,7 +167,7 @@ fi || { (exit 127); exit 127; }
 gztmp=$gztmpdir/$0
 case $0 in
 -* | */*'
-') mkdir -p "$gztmp" && rmdir "$gztmp";;
+') mkdir -p "$gztmp" && rm -r "$gztmp";;
 */*) gztmp=$gztmpdir/`basename "$0"`;;
 esac || { (exit 127); exit 127; }

Index: zdiff.in
===================================================================
RCS file: /cvsroot/gzip/gzip/zdiff.in,v
retrieving revision 1.8
diff -u -p -r1.8 zdiff.in
--- zdiff.in    4 Jan 2007 08:03:20 -0000       1.8
+++ zdiff.in    5 Feb 2007 20:54:23 -0000
@@ -1,30 +1,40 @@
 #!/bin/sh
 # sh is buggy on RS/6000 AIX 3.2. Replace above line with #!/bin/ksh

-# Zcmp and zdiff are used to invoke the cmp or the  diff  pro-
-# gram  on compressed files.  All options specified are passed
-# directly to cmp or diff.  If only 1 file is specified,  then
-# the  files  compared  are file1 and an uncompressed file1.gz.
-# If two files are specified, then they are  uncompressed  (if
-# necessary) and fed to cmp or diff.  The exit status from cmp
-# or diff is preserved.
-
-PATH="BINDIR:$PATH"; export PATH
-case "$0" in
-  *cmp) prog=cmp ; cmp='${CMP-cmp}'  ;;
+# Copyright (C) 1998, 2002, 2006, 2007 Free Software Foundation
+# Copyright (C) 1993 Jean-loup Gailly
+
+# 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.
+
+PATH=BINDIR:$PATH
+
+case $1 in
+  --__cmp) shift
+       prog=cmp;  cmp='${CMP-cmp}'  ;;
   *)    prog=diff; cmp='${DIFF-diff}';;
 esac
-cmp0=$cmp

 version="z$prog (gzip) @VERSION@
-Copyright (C) 2006 Free Software Foundation, Inc.
+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 Jean-loup Gailly."

-usage="Usage: z$prog [OPTION]... FILE1 [FILE2]
+usage="Usage: $0 [OPTION]... FILE1 [FILE2]
 Compare FILE1 to FILE2, using their uncompressed contents if they are
 compressed.  If FILE2 is omitted, compare FILE1 to the uncompressed
 contents of FILE1.gz.  Do comparisons like '$prog' does.
@@ -33,16 +43,23 @@ OPTIONs are the same as for '$prog'.

 Report bugs to <address@hidden>."

-FILES=
+# sed script to escape all ' for the shell, and then (to handle trailing
+# newlines correctly) turn trailing X on last line into '.
+escape='
+  s/'\''/'\''\\'\'''\''/g
+  $s/X$/'\''/
+'
+
 while :; do
   case $1 in
-  --h*) echo "$usage" || exit 2; exit;;
+  --h*) printf '%s\n' "$usage" || exit 2; exit;;
   --v*) echo "$version" || exit 2; exit;;
   --) shift; break;;
-  -*\'*) echo >&2 "$prog: $1: option contains apostrophe"; exit 2;;
-  -?*) cmp="$cmp '$1'"; shift;;
+  -*\'*) cmp="$cmp '"`printf '%sX\n' "$1" | sed "$escape"`;;
+  -?*) cmp="$cmp '$1'";;
   *) break;;
   esac
+  shift
 done
 cmp="$cmp --"

@@ -51,13 +68,19 @@ do
   test "X$file" = X- || <"$file" || exit 2
 done

+gzip_status=0
+exec 3>&1
+
 if test $# -eq 1; then
   case $1 in
   *[-.]gz* | *[-.][zZ] | *.t[ga]z)
     FILE=`expr "X$1" : 'X\(.*\)[-.][zZtga]*$'`
-    gzip -cd -- "$1" | eval "$cmp" - '"$FILE"';;
+    gzip_status=$(
+      exec 4>&1
+      (gzip -cd -- "$1" 4>&-; echo $? >&4) 3>&- | eval "$cmp" - '"$FILE"' >&3
+    );;
   *)
-    echo >&2 "$prog: $1: unknown compressed file extension"
+    echo >&2 "$0: $1: unknown compressed file extension"
     exit 2;;
   esac
 elif test $# -eq 2; then
@@ -66,16 +89,27 @@ elif test $# -eq 2; then
                 case "$2" in
                *[-.]gz* | *[-.][zZ] | *.t[ga]z | -)
                    if test "$1$2" = --; then
-                       gzip -cdfq - | eval "$cmp" - -
+                       gzip_status=$(
+                         exec 4>&1
+                         (gzip -cdfq - 4>&-; echo $? >&4) 3>&- |
+                           eval "$cmp" - - >&3
+                       )
                    elif
                        # Reject Solaris 8's buggy /bin/bash 2.03.
                        echo X |
-                        (echo X | eval "$cmp0" /dev/fd/3 - >/dev/null 2>&1) \
-                               3<&0
+                        (echo X | eval "$cmp" /dev/fd/5 - >/dev/null 2>&1) \
+                               5<&0
                    then
-                       gzip -cdfq -- "$1" |
-                         (gzip -cdfq -- "$2" |
-                          eval "$cmp" /dev/fd/3 -) 3<&0
+                       gzip_status=$(
+                         exec 4>&1
+                         (gzip -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- |
+                           ((gzip -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- 5<&- 
</dev/null |
+                              eval "$cmp" /dev/fd/5 -) 5<&0
+                       )
+                       case $gzip_status in
+                         *[1-9]*) gzip_status=1;;
+                         *) gzip_status=0;;
+                       esac
                    else
                        F=`expr "/$2" : '.*/\(.*\)[-.][zZtga]*$'` || F=$prog
                        tmp=
@@ -84,27 +118,44 @@ elif test $# -eq 2; then
                          (exit 2); exit 2
                        ' HUP INT PIPE TERM 0
                        if type mktemp >/dev/null 2>&1; then
-                         tmp=`mktemp -t -- "$F.XXXXXX"` || exit
+                         tmp=`mktemp -t -- "$F.XXXXXX"` || exit 2
                        else
                          set -C
                          tmp=${TMPDIR-/tmp}/$F.$$
                        fi
-                       gzip -cdfq -- "$2" > "$tmp" || exit
-                       gzip -cdfq -- "$1" | eval "$cmp" - '"$tmp"'
-                        STAT="$?"
-                       rm -f "$tmp" || STAT=2
+                       gzip -cdfq -- "$2" > "$tmp" || exit 2
+                       gzip_status=$(
+                         exec 4>&1
+                         (gzip -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- |
+                           eval "$cmp" - '"$tmp"' >&3
+                       )
+                        cmp_status=$?
+                       rm -f "$tmp" || gzip_status=$?
                        trap - HUP INT PIPE TERM 0
-                       exit $STAT
+                       (exit $cmp_status)
                    fi;;
-               *)      gzip -cdfq -- "$1" | eval "$cmp" - '"$2"';;
+               *)
+                   gzip_status=$(
+                     exec 4>&1
+                     (gzip -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- |
+                       eval "$cmp" - '"$2"' >&3
+                   );;
                 esac;;
         *)      case "$2" in
                *[-.]gz* | *[-.][zZ] | *.t[ga]z | -)
-                       gzip -cdfq -- "$2" | eval "$cmp" '"$1"' -;;
+                       gzip_status=$(
+                         exec 4>&1
+                         (gzip -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- |
+                           eval "$cmp" '"$1"' - >&3
+                       );;
                *)      eval "$cmp" '"$1"' '"$2"';;
                 esac;;
        esac
 else
-       echo >&2 "$usage"
+       echo >&2 "$0: invalid number of operands; try \`$0 --help' for help"
        exit 2
 fi
+
+cmp_status=$?
+test "$gzip_status" -eq 0 || exit 2
+exit $cmp_status
Index: zforce.in
===================================================================
RCS file: /cvsroot/gzip/gzip/zforce.in,v
retrieving revision 1.5
diff -u -p -r1.5 zforce.in
--- zforce.in   9 Dec 2006 04:25:56 -0000       1.5
+++ zforce.in   5 Feb 2007 20:54:23 -0000
@@ -6,7 +6,7 @@
 # 12345678901234 is renamed to 12345678901.gz


-# Copyright (C) 2002 Free Software Foundation
+# Copyright (C) 2002, 2007 Free Software Foundation
 # Copyright (C) 1993 Jean-loup Gailly

 # This program is free software; you can redistribute it and/or modify
@@ -26,14 +26,14 @@
 PATH="BINDIR:$PATH"; export PATH

 version="zforce (gzip) @VERSION@
-Copyright (C) 2006 Free Software Foundation, Inc.
+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 Jean-loup Gailly."

-usage="Usage: zforce [FILE]...
+usage="Usage: $0 [FILE]...
 Force a .gz extension on all compressed FILEs so that gzip will
 not compress them twice.

Index: zgrep.in
===================================================================
RCS file: /cvsroot/gzip/gzip/zgrep.in,v
retrieving revision 1.8
diff -u -p -r1.8 zgrep.in
--- zgrep.in    30 Dec 2006 03:01:51 -0000      1.8
+++ zgrep.in    5 Feb 2007 20:54:23 -0000
@@ -3,7 +3,7 @@
 # zgrep -- a wrapper around a grep program that decompresses files as needed
 # Adapted from a version sent by Charles Levert <address@hidden>

-# Copyright (C) 1998, 2001, 2002, 2006 Free Software Foundation
+# Copyright (C) 1998, 2001, 2002, 2006, 2007 Free Software Foundation
 # Copyright (C) 1993 Jean-loup Gailly

 # This program is free software; you can redistribute it and/or modify
@@ -20,27 +20,22 @@
 # 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
+PATH=BINDIR:$PATH
+grep='${GREP-grep}'

-case "$0" in
-(*egrep)       grep='${EGREP-egrep}'   ;;
-(*fgrep)       grep='${FGREP-fgrep}'   ;;
-(*)            grep='${GREP-grep}'     ;;
-esac
-
-eval 'version="z'"$grep"' (gzip) @VERSION@
-Copyright (C) 2006 Free Software Foundation, Inc.
+version='zgrep (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 Jean-loup Gailly."'
+Written by Jean-loup Gailly.'

-usage="Usage: z$grep [OPTION]... [-e] PATTERN [FILE]...
+usage="Usage: $0 [OPTION]... [-e] PATTERN [FILE]...
 Look for instances of PATTERN in the input FILEs, using their
 uncompressed contents if they are compressed.

-OPTIONs are the same as for '$grep'.
+OPTIONs are the same as for 'grep'.

 Report bugs to <address@hidden>."

@@ -70,7 +65,6 @@ while test $# -ne 0; do
   (--binary-*=* | --[lm]a*=* | --reg*=*)
     ;;
   (-[ABCDefm] | --binary-* | --file | --[lm]a* | --reg*)
-    have_optarg=1
     case ${1?"$option option requires an argument"} in
     (*\'*)
       optarg=" '"$(printf '%sX\n' "$1" | sed "$escape");;
Index: zless.in
===================================================================
RCS file: /cvsroot/gzip/gzip/zless.in,v
retrieving revision 1.6
diff -u -p -r1.6 zless.in
--- zless.in    30 Dec 2006 04:06:44 -0000      1.6
+++ zless.in    5 Feb 2007 20:54:23 -0000
@@ -1,6 +1,6 @@
 #!/bin/sh

-# Copyright (C) 1998, 2002, 2006 Free Software Foundation
+# Copyright (C) 1998, 2002, 2006, 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
@@ -19,14 +19,14 @@
 PATH="BINDIR:$PATH"; export PATH

 version="zless (gzip) @VERSION@
-Copyright (C) 2006 Free Software Foundation, Inc.
+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: zless [OPTION]... [FILE]...
+usage="Usage: $0 [OPTION]... [FILE]...
 Like 'less', but operate on the uncompressed contents of any compressed FILEs.

 Options are the same as for 'less'.
Index: zmore.in
===================================================================
RCS file: /cvsroot/gzip/gzip/zmore.in,v
retrieving revision 1.5
diff -u -p -r1.5 zmore.in
--- zmore.in    9 Dec 2006 04:25:56 -0000       1.5
+++ zmore.in    5 Feb 2007 20:54:23 -0000
@@ -1,6 +1,6 @@
 #!/bin/sh

-# Copyright (C) 2001, 2002 Free Software Foundation
+# Copyright (C) 2001, 2002, 2007 Free Software Foundation
 # Copyright (C) 1992, 1993 Jean-loup Gailly

 # This program is free software; you can redistribute it and/or modify
@@ -20,14 +20,14 @@
 PATH="BINDIR:$PATH"; export PATH

 version="zmore (gzip) @VERSION@
-Copyright (C) 2006 Free Software Foundation, Inc.
+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 Jean-loup Gailly."

-usage="Usage: zmore [OPTION]... [FILE]...
+usage="Usage: $0 [OPTION]... [FILE]...
 Like 'more', but operate on the uncompressed contents of any compressed FILEs.

 Report bugs to <address@hidden>."
Index: znew.in
===================================================================
RCS file: /cvsroot/gzip/gzip/znew.in,v
retrieving revision 1.6
diff -u -p -r1.6 znew.in
--- znew.in     9 Dec 2006 04:25:56 -0000       1.6
+++ znew.in     5 Feb 2007 20:54:23 -0000
@@ -1,6 +1,6 @@
 #!/bin/sh

-# Copyright (C) 1998, 2002, 2004 Free Software Foundation
+# Copyright (C) 1998, 2002, 2004, 2007 Free Software Foundation
 # Copyright (C) 1993 Jean-loup Gailly

 # This program is free software; you can redistribute it and/or modify
@@ -20,14 +20,14 @@
 PATH="BINDIR:$PATH"; export PATH

 version="znew (gzip) @VERSION@
-Copyright (C) 2006 Free Software Foundation, Inc.
+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 Jean-loup Gailly."

-usage="Usage: znew [OPTION]... [FILE]...
+usage="Usage: $0 [OPTION]... [FILE]...
 Recompress files from .Z (compress) format to .gz (gzip) format.

 Options:
Index: gzip.c
===================================================================
RCS file: /cvsroot/gzip/gzip/gzip.c,v
retrieving revision 1.13
diff -u -p -r1.13 gzip.c
--- gzip.c      27 Dec 2006 08:00:43 -0000      1.13
+++ gzip.c      5 Feb 2007 20:54:23 -0000
@@ -1,6 +1,6 @@
 /* gzip (GNU zip) -- compress files with zip algorithm and 'compress' interface

-   Copyright (C) 1999, 2001, 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002, 2006, 2007 Free Software Foundation, Inc.
    Copyright (C) 1992-1993 Jean-loup Gailly

    This program is free software; you can redistribute it and/or modify
@@ -28,7 +28,7 @@
  */

 static char  *license_msg[] = {
-"Copyright (C) 2006 Free Software Foundation, Inc.",
+"Copyright (C) 2007 Free Software Foundation, Inc.",
 "Copyright (C) 1993 Jean-loup Gailly.",
 "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>.",
@@ -409,8 +409,11 @@ int main (argc, argv)
     if (env != NULL) args = argv;

 #ifndef GNU_STANDARD
+# define GNU_STANDARD 1
+#endif
+#if !GNU_STANDARD
     /* For compatibility with old compress, use program name as an option.
-     * If you compile with -DGNU_STANDARD, this program will behave as
+     * Unless you compile with -DGNU_STANDARD=0, this program will behave as
      * gzip even if it is invoked under the name gunzip or zcat.
      *
      * Systems which do not support links can still use -d or -dc.
Index: zgrep.1
===================================================================
RCS file: /cvsroot/gzip/gzip/zgrep.1,v
retrieving revision 1.1
diff -u -p -r1.1 zgrep.1
--- zgrep.1     16 Jun 1993 15:31:53 -0000      1.1
+++ zgrep.1     5 Feb 2007 20:54:23 -0000
@@ -7,38 +7,23 @@ zgrep \- search possibly compressed file
 .BI  [\ -e\ ] " pattern"
 .IR filename ".\|.\|."
 .SH DESCRIPTION
-.IR  Zgrep
-is used to invoke the
+.I Zgrep
+invokes
 .I grep
-on compress'ed or gzip'ed files. All options specified are passed directly to
-.I grep.
+on compressed or gzipped files.
+All options specified are passed directly to
+.IR grep .
 If no file is specified, then the standard input is decompressed
 if necessary and fed to grep.
 Otherwise the given files are uncompressed if necessary and fed to
-.I grep.
+.IR grep .
 .PP
-If
-.I zgrep
-is invoked as
-.I zegrep
-or
-.I zfgrep
-then
-.I egrep
-or
-.I fgrep
-is used instead of
-.I grep.
 If the GREP environment variable is set,
 .I zgrep
 uses it as the
 .I grep
-program to be invoked. For example:
-
-    for sh:  GREP=fgrep  zgrep string files
-    for csh: (setenv GREP fgrep; zgrep string files)
+program to be invoked.
 .SH AUTHOR
 Charles Levert (address@hidden)
 .SH "SEE ALSO"
-grep(1), egrep(1), fgrep(1), zdiff(1), zmore(1), znew(1), zforce(1),
-gzip(1), gzexe(1)
+grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)
Index: zless.1
===================================================================
RCS file: /cvsroot/gzip/gzip/zless.1,v
retrieving revision 1.3
diff -u -p -r1.3 zless.1
--- zless.1     20 Nov 2006 08:40:34 -0000      1.3
+++ zless.1     5 Feb 2007 20:54:23 -0000
@@ -8,7 +8,9 @@ zless \- file perusal filter for crt vie
 .I  Zless
 is a filter which allows examination of compressed or plain text files
 one screenful at a time on a soft-copy terminal.  It is the equivalent of
-setting the environment variable LESSOPEN to "|gzip -cdfq -- %s",
+setting the environment variable LESSOPEN to '|gzip -cdfq -- %s',
+and the environment variable LESSMETACHARS to
+'<space><tab><newline>;*?"()<>[|&^`#\$%=~',
 and then running
 .IR less .
 However, enough people seem to think that having the




reply via email to

[Prev in Thread] Current Thread [Next in Thread]