gzip: remove --__bindir
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Mar 2016 01:18:59 +0000 (17:18 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Mar 2016 08:18:30 +0000 (00:18 -0800)
* NEWS: Document this.
* gzexe.in, gunzip.in, zcat.in, zcmp.in, zdiff.in, zegrep.in:
* zfgrep.in, zforce.in, zgrep.in, zless.in, zmore.in, znew.in:
Remove support for undocumented --__bindir option.  Callers can
set PATH instead; that's less error-prone.  This fixes some
'make check' failures on my Solaris 11 box, which occurred
because the test scripts were mistakenly testing the installed
gzip rather than the gzip in the working directory.
* Makefile.am (.in): Don't replace bindir.
(check-local): Set PATH instead of using --__bindir.
* tests/help-version (gunzip_setuphelp, gzexe_setuphelp)
(zcat_setuphelp, zcmp_setuphelp, zdiff_setuphelp)
(zegrep_setuphelp, zfgrep_setuphelp, zforce_setuphelp)
(zgrep_setuphelp, zless_setuphelp, zmore_setuphelp)
(znew_setuphelp): Remove.  All uses removed.
(lbracket_setup): Default args to empty.

15 files changed:
Makefile.am
NEWS
gunzip.in
gzexe.in
tests/help-version
zcat.in
zcmp.in
zdiff.in
zegrep.in
zfgrep.in
zforce.in
zgrep.in
zless.in
zmore.in
znew.in

index b01ddee020afd808535e7bcd6f8ed9843b96d055..8fb17b9d15c065cd961c3dc48671d4056f3617fb 100644 (file)
@@ -82,7 +82,6 @@ SUFFIXES = .in
 .in:
        $(AM_V_GEN)sed \
                -e 's|/bin/sh|$(SHELL)|g' \
-               -e 's|[@]bindir@|'\''$(bindir)'\''|g' \
                -e 's|[@]GREP@|$(GREP)|g' \
                -e 's|[@]VERSION@|$(VERSION)|g' \
                $(srcdir)/$@.in >$@-t \
@@ -108,17 +107,18 @@ gen-ChangeLog:
 FILES_TO_CHECK = $(bin_SCRIPTS) \
   $(top_srcdir)/ChangeLog $(top_srcdir)/configure $(top_srcdir)/gzip.c
 check-local: $(FILES_TO_CHECK) $(bin_PROGRAMS) gzip.doc.gz
-       $(AM_V_GEN){ test '$(srcdir)' != . \
-                      || ./zdiff --__bindir . -c gzip.doc.gz; }
-       $(AM_V_at)./zdiff --__bindir . -c $(srcdir)/gzip.doc $(srcdir)/gzip.doc
-       $(AM_V_at)./zdiff --__bindir . $(srcdir)/gzip.doc gzip.doc.gz
-       $(AM_V_at)./zdiff --__bindir . -c - $(srcdir)/gzip.doc <gzip.doc.gz
-       $(AM_V_at)./zdiff --__bindir . -c gzip.doc.gz gzip.doc.gz
-       $(AM_V_at)./zgrep --__bindir . -iV >/dev/null
-       $(AM_V_at)for opt in --rsyncable '' -1 -9; do   \
+       $(AM_V_GEN)PATH=.:$$PATH; { test '$(srcdir)' != . \
+                      || zdiff -c gzip.doc.gz; }
+       $(AM_V_at)PATH=.:$$PATH; zdiff -c $(srcdir)/gzip.doc $(srcdir)/gzip.doc
+       $(AM_V_at)PATH=.:$$PATH; zdiff $(srcdir)/gzip.doc gzip.doc.gz
+       $(AM_V_at)PATH=.:$$PATH; zdiff -c - $(srcdir)/gzip.doc <gzip.doc.gz
+       $(AM_V_at)PATH=.:$$PATH; zdiff -c gzip.doc.gz gzip.doc.gz
+       $(AM_V_at)PATH=.:$$PATH; zgrep -iV >/dev/null
+       $(AM_V_at)PATH=.:$$PATH;                        \
+       for opt in --rsyncable '' -1 -9; do             \
           for file in $(FILES_TO_CHECK); do            \
-            ./gzip $$opt -c -- "$$file"                        \
-              | ./gzip -d | cmp - "$$file" || exit 1;  \
+            gzip $$opt -c -- "$$file"                  \
+              | gzip -d | cmp - "$$file" || exit 1;    \
           done;                                                \
        done
 
diff --git a/NEWS b/NEWS
index e3815d1c9b02afdb9454c9d071745dbba73b69c9..6363d71bdb9f50432ce4c093ac9682cc0b13d3f3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,12 @@ GNU gzip NEWS                                    -*- outline -*-
   it is used, and rejects attempts to use dangerous options or operands.
   You can use an alias or script instead.
 
+  Installed programs like 'zgrep' now use the PATH environment variable
+  as usual to find subsidiary programs like 'gzip' and 'grep'.
+  Previously they prepended the installation directory to the PATH,
+  which sometimes caused 'make check' to test the wrong gzip executable.
+  [bug introduced in gzip-1.3.13]
+
 ** New features
 
   gzip now accepts the --synchronous option, which causes it to use
index d7edb53f828df69e123ecb3c6e067e4f113f2640..1346b35d91634a99dcf976df15b2b55e2094a998 100644 (file)
--- a/gunzip.in
+++ b/gunzip.in
 # 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, 2011-2016 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
index 6b61ec41c3f813b7e739e67f31d1dad9ec25c095..b3339937418969d7eef907d3c94b39e21ebf0a9f 100644 (file)
--- a/gzexe.in
+++ b/gzexe.in
@@ -53,13 +53,6 @@ Rename each FILE with a compressed version of itself, renaming FILE to FILE~.
 
 Report bugs to <bug-gzip@gnu.org>."
 
-
-bindir=@bindir@
-case $1 in
---__bindir) bindir=${2?}; shift; shift;;
-esac
-PATH=$bindir:$PATH
-
 decomp=0
 res=0
 while :; do
index 00b4c3491db56b4741bcb35549c6af51d0b00a0d..5af9a0509eba1b8fbab3121129a35ee3c6f2e136 100755 (executable)
@@ -55,19 +55,6 @@ expected_failure_status_grep=2
 expected_failure_status_egrep=2
 expected_failure_status_fgrep=2
 
-gunzip_setuphelp () { args="--__bindir '$abs_top_builddir'"; }
-gzexe_setuphelp () { gunzip_setuphelp; }
-zcat_setuphelp () { gunzip_setuphelp; }
-zcmp_setuphelp () { gunzip_setuphelp; }
-zdiff_setuphelp () { gunzip_setuphelp; }
-zegrep_setuphelp () { gunzip_setuphelp; }
-zfgrep_setuphelp () { gunzip_setuphelp; }
-zforce_setuphelp () { gunzip_setuphelp; }
-zgrep_setuphelp () { gunzip_setuphelp; }
-zless_setuphelp () { gunzip_setuphelp; }
-zmore_setuphelp () { gunzip_setuphelp; }
-znew_setuphelp () { gunzip_setuphelp; }
-
 test "$built_programs" \
   || fail_ "built_programs not specified!?!"
 
@@ -97,11 +84,7 @@ for lang in C fr da; do
       continue
     fi
 
-    if type ${i}_setuphelp > /dev/null 2>&1; then
-      ${i}_setuphelp
-    else
-      args=
-    fi
+    args=
 
     # The just-built install executable is always named `ginstall'.
     test $i = install && i=ginstall
@@ -170,18 +153,18 @@ cmp_setup () { args="$tmp_in $tmp_in2"; }
 # The transfer rate would vary between runs.
 dd_setup () { args=status=noxfer; }
 
-zdiff_setup () { gunzip_setuphelp; args="$args $zin $zin2"; }
+zdiff_setup () { args="$args $zin $zin2"; }
 zcmp_setup () { zdiff_setup; }
-zcat_setup () { gunzip_setuphelp; args="$args $zin"; }
+zcat_setup () { args="$args $zin"; }
 gunzip_setup () { zcat_setup; }
 zmore_setup () { zcat_setup; }
 zless_setup () { zcat_setup; }
-znew_setup () { gunzip_setuphelp; args="$args $bigZ_in"; }
+znew_setup () { args="$args $bigZ_in"; }
 zforce_setup () { zcat_setup; }
-zgrep_setup () { gunzip_setuphelp; args="$args z $zin"; }
+zgrep_setup () { args="$args z $zin"; }
 zegrep_setup () { zgrep_setup; }
 zfgrep_setup () { zgrep_setup; }
-gzexe_setup () { gunzip_setuphelp; args="$args $tmp_in"; }
+gzexe_setup () { args="$args $tmp_in"; }
 
 # We know that $tmp_in contains a "0"
 grep_setup () { args="0 $tmp_in"; }
@@ -271,10 +254,9 @@ for i in $built_programs; do
   mkdir $tmp_dir
   # echo ================== $i
   test $i = [ && prog=lbracket || prog=$i
+  args=
   if type ${prog}_setup > /dev/null 2>&1; then
     ${prog}_setup
-  else
-    args=
   fi
   if eval "env \$i $args < \$tmp_in > \$tmp_out"; then
     : # ok
diff --git a/zcat.in b/zcat.in
index d8ffd8576b75e46286c40be56ccd8c98c3d63dc9..54befb4bbc0fa687a6ab8d10ea88f4801cebe5ac 100644 (file)
--- a/zcat.in
+++ b/zcat.in
 # 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, 2011-2016 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
diff --git a/zcmp.in b/zcmp.in
index d099223bc3f2f2b6d0f8d8edb5ffd11e486741fe..eeee24783350081ce947ad987cf4fed6ddf54df2 100644 (file)
--- a/zcmp.in
+++ b/zcmp.in
 # 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) 2010 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
@@ -48,4 +42,4 @@ case $1 in
 --version) echo "$version" || st=2; exit $st;;
 esac
 
-exec zdiff --__bindir "$bindir" --__cmp "$@"
+exec zdiff --__cmp "$@"
index f1fa95fd4997144138e60d0330ce5ebef1561fde..f2f5435187dfadec6611c55ab843cf13cf3b0866 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.
 
-bindir=@bindir@
-case $1 in
---__bindir) bindir=${2?}; shift; shift;;
-esac
-PATH=$bindir:$PATH
-
 case $1 in
   --__cmp) shift
         prog=cmp;  cmp='${CMP-cmp}'  ;;
index 99855efa02efba931966dc88406e155470ff118b..e5969b7a298dec1af47827dcc00e2413435aa6ce 100644 (file)
--- a/zegrep.in
+++ b/zegrep.in
@@ -1,7 +1,2 @@
 #!/bin/sh
-bindir=@bindir@
-case $1 in
---__bindir) bindir=${2?}; shift; shift;;
-esac
-PATH=$bindir:$PATH
-exec zgrep --__bindir "$bindir" -E "$@"
+exec zgrep -E "$@"
index df172010f8b3c5e75b9d243ccd59c7751faeba3e..fd7be2bfb1bd6a6d2dcc8e92572b50d7860b3450 100644 (file)
--- a/zfgrep.in
+++ b/zfgrep.in
@@ -1,7 +1,2 @@
 #!/bin/sh
-bindir=@bindir@
-case $1 in
---__bindir) bindir=${2?}; shift; shift;;
-esac
-PATH=$bindir:$PATH
-exec zgrep --__bindir "$bindir" -F "$@"
+exec zgrep -F "$@"
index 5baff0778d1eaa85b68f8cb1810f1aa6bb86ee6f..82ad330e3afb2d684b7cab682aa2eaa476dd4ac6 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.
 
-bindir=@bindir@
-case $1 in
---__bindir) bindir=${2?}; shift; shift;;
-esac
-PATH=$bindir:$PATH; export PATH
-
 version="zforce (gzip) @VERSION@
 Copyright (C) 2010-2016 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
index d94b8d84f8612783d7e98ada84cc0f41f733e8f6..0ad1b8a100ee0b3a07bf38c8859121983e6c24be 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.
 
-bindir=@bindir@
-case $1 in
---__bindir) bindir=${2?}; shift; shift;;
-esac
-PATH=$bindir:$PATH
-
 grep='${GREP-'\''@GREP@'\''}'
 
 version='zgrep (gzip) @VERSION@
index a3edcc7ed520cd2050e64864be49c4534c0181e6..e634af660365ccdc77af21c185f9b4ce8a647310 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.
 
-bindir=@bindir@
-case $1 in
---__bindir) bindir=${2?}; shift; shift;;
-esac
-PATH=$bindir:$PATH; export PATH
-
 version="zless (gzip) @VERSION@
 Copyright (C) 2007, 2011-2016 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
index b1bb68f029978465abb6814c10fbf85dffc456d5..0193a1bb26e1cc849f36cd9ef42ed4e84d6d2f4a 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.
 
-bindir=@bindir@
-case $1 in
---__bindir) bindir=${2?}; shift; shift;;
-esac
-PATH=$bindir:$PATH; export PATH
-
 version="zmore (gzip) @VERSION@
 Copyright (C) 2010-2016 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
diff --git a/znew.in b/znew.in
index ec025d2ca6887a94fea26549153620232b59cf6c..12f89fc5ac7f3980d4c7621fca7932949ae73aca 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.
 
-bindir=@bindir@
-case $1 in
---__bindir) bindir=${2?}; shift; shift;;
-esac
-PATH=$bindir:$PATH; export PATH
-
 version="znew (gzip) @VERSION@
 Copyright (C) 2010-2016 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of