delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/05/24/08:33:19

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <42931EFA.4030400@byu.net>
Date: Tue, 24 May 2005 06:32:58 -0600
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
MIME-Version: 1.0
To: Stepan Kasal <kasal AT ucw DOT cz>
CC: Karl Berry <karl AT freefriends DOT org>, dave AT boost-consulting DOT com,
akim AT epita DOT fr, cygwin AT cygwin DOT com, bug-texinfo AT gnu DOT org
Subject: Re: Fw: bug in texi2dvi, and hack patch
References: <20050124083421 DOT GA2986 AT matsrv DOT math DOT cas DOT cz> <200502110143 DOT j1B1hnC00593 AT f7 DOT net> <20050524122225 DOT GA29608 AT math DOT cas DOT cz>
In-Reply-To: <20050524122225.GA29608@math.cas.cz>
X-IsSubscribed: yes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Stepan Kasal on 5/24/2005 6:22 AM:
> So my job was to fix the comment.  Well, I actually replaced the code
> together with the comments, to get something which is easier to explain.
> (Actually, my code is close to what Autoconf does.)
> 
> See the attached patch.
> I hope I haven't screwed anything.
> 
> Have a nice day,
> 	Stepan Kasal
> 
> PS: if ebb9 or dave can actually fwd this to the cygwin list, that might be
> a good idea; I'm not subscribed there.
Cygwin is an open list, so your comment already made it there.

> @@ -130,16 +130,15 @@
>    saveIFS=$IFS
>    IFS=$path_sep  # break path components at the path separator
>    for dir in $PATH; do
> +    # The basic test for an executable is `test -f $f && test -x $f'.
> +    # `test -x' is not enough, because it can also be true for directories.
> +    #
> +    # On Cygwin and DJGPP, `test -x' also looks for .exe.  On Cygwin, also
> +    # `test -f' has this enhancement, bot not on DJGPP.  (Both are design
> +    # decisions, so there is little chance to make them consistent.)
> +    # Thus we have to try `test -f' twice.
> +    if  test -x "$dir/$1" &&
> +	{ test -f "$dir/$1" || test -f "$dir/$1.exe"; }; then

Not quite.  Now, if both tex and tex.exe exist, but tex is not executable,
then you just failed to find tex.exe on cygwin.  If you are going to use
test -f on both tex and tex.exe, then you also need to do so with test -x:
if { test -x "$dir/$1" || test -x "$dir/$1.exe"; } &&
   { test -f "$dir/$1" || test -f "$dir/$1.exe"; }; then

And even that is not quite right - suppose tex is a directory, so just
test -x passes, and tex.exe is a non-executable file, so just test -f
passes.  Maybe something more like this is needed:
if { test -x "$dir/$1" && test -f "$dir/$1"; } ||
   { test -x "$dir/$1.exe" && test -f "$dir/$1.exe"; }; then

- --
Life is short - so eat dessert first!

Eric Blake             ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCkx7684KuGfSFAYARAqz/AJwLx4nwhDPKVEuP3m0pf+QXgGGjqQCfaf4k
rp4jmGPs+9j50+V5ol24aJQ=
=teko
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019