From: Paul Eggert Date: Fri, 4 May 2007 19:53:25 +0000 (+0000) Subject: * Makefile.am (.in): Substitute @bindir@, not BINDIR, for X-Git-Tag: v1.3.13~44 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=4858351c63f69ea0563bda954c55b875c0c7e7be;p=debian%2Fgzip * 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 . * 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 . --- diff --git a/ChangeLog b/ChangeLog index 4f2ea42..063130e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2007-05-04 Paul Eggert + + * 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 + . + * 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 + . + 2007-04-28 Paul Eggert * m4/shell.m4 (AC_PROG_SHELL): Check for old-fashioned shells that diff --git a/Makefile.am b/Makefile.am index 5799d75..3aceed6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 /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 /dev/null for file in $(FILES_TO_CHECK); do \ ./gzip -cv -- "$$file" | ./gzip -d | cmp - "$$file" || exit; \ done diff --git a/gunzip.in b/gunzip.in index 9490f16..52cf180 100644 --- 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 . +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 ." + +case $1 in +--help) exec echo "$usage";; +--version) exec echo "$version";; +esac + exec gzip -d "$@" diff --git a/gzexe.in b/gzexe.in index 0acd3bb..281538d 100644 --- 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 ." -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 0ef85cf..4886ec4 100644 --- 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 . +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 ." + +case $1 in +--help) exec echo "$usage";; +--version) exec echo "$version";; +esac + exec gzip -cd "$@" diff --git a/zcmp.in b/zcmp.in index 23284ff..4747593 100644 --- 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 . +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 ." + +case $1 in +--help) exec echo "$usage";; +--version) exec echo "$version";; +esac + exec zdiff --__cmp "$@" diff --git a/zdiff.in b/zdiff.in index fda3259..2245209 100644 --- a/zdiff.in +++ b/zdiff.in @@ -18,7 +18,11 @@ # 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 diff --git a/zegrep.in b/zegrep.in index 620b8cb..800210f 100644 --- 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 "$@" diff --git a/zfgrep.in b/zfgrep.in index 7962364..c458d96 100644 --- 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 "$@" diff --git a/zforce.in b/zforce.in index b1a995e..c7f9ba2 100644 --- a/zforce.in +++ b/zforce.in @@ -23,7 +23,11 @@ # 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. diff --git a/zgrep.in b/zgrep.in index 8350d92..9e1ece2 100644 --- a/zgrep.in +++ b/zgrep.in @@ -20,7 +20,12 @@ # 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@ diff --git a/zless.in b/zless.in index 52352cb..7325434 100644 --- a/zless.in +++ b/zless.in @@ -16,7 +16,11 @@ # 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. diff --git a/zmore.in b/zmore.in index 8ed26ae..5194f8f 100644 --- a/zmore.in +++ b/zmore.in @@ -17,7 +17,11 @@ # 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 97faa04..cc2a05c 100644 --- a/znew.in +++ b/znew.in @@ -17,7 +17,11 @@ # 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.