bug-gzip
[Top][All Lists]
Advanced

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

Re: make check calls zgrep from zutils


From: Antonio Diaz Diaz
Subject: Re: make check calls zgrep from zutils
Date: Wed, 10 Apr 2013 18:29:05 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905

Paul Eggert wrote:
For the PATH problem, one possibility is that your shell is
buggy, and isn't respecting PATH properly.  You might be
able to debug this with sh -x.

My shell is bash, and it seems to respect PATH.

I have received a confirmation from Matias Fonzo that the check fails for him too.

I have also verified that the hash in bash can falsify the result by executing the remembered executable instead of the first one in the PATH. Maybe you need to run 'hash -r' before running 'make check'.

I think the problem is in the way gzip scripts try to locate executables. For example, from zcmp:

---------------------------
bindir='/usr/local/bin'
case $1 in
--__bindir) bindir=${2?}; shift; shift;;
esac
PATH=$bindir:$PATH
[...]
exec zdiff --__cmp "$@"
---------------------------

If invoked without the '--__bindir' option the code above will execute '/usr/local/bin/zdiff', regardless of where the invoked zcmp is located.

For example, with zutils installed in '/usr/local/bin/' switch to the gzip directory and try:

  $ ./zcmp gzip.doc gzip.doc.gz
  zdiff: unrecognized option '--__cmp'
  Try 'zdiff --help' for more information.
  $ ./zcmp --__bindir . gzip.doc gzip.doc.gz
  $


I think a better way to locate executables would be the one used by GNU ed in the 'red' script:

bindir=`echo "$0" | sed -e 's,[^/]*$,,'`
exec "${bindir}"ed --restricted "$@"

The code above always executes the 'ed' located in the same directory where the invoked 'red' is.


Best regards,
Antonio.




reply via email to

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