Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Mon, 24 Jan 2005 09:34:21 +0100 From: Stepan Kasal To: Karl Berry Cc: ebb9 AT byu DOT net, 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 Message-ID: <20050124083421.GA2986@matsrv.math.cas.cz> References: <41EE544A DOT 2000306 AT byu DOT net> <200501240115 DOT j0O1FWh15382 AT f7 DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200501240115.j0O1FWh15382@f7.net> User-Agent: Mutt/1.4.1i X-Virus-Status: Clean X-Spam-Status: No, hits=-1.4 required=5.0 tests=BAYES_20 autolearn=no version=2.64 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on matsrv.math.cas.cz Hi, On Sun, Jan 23, 2005 at 08:15:32PM -0500, Karl Berry wrote: > Regarding texi2dvi and cygwin, please see if the new version (below) works. > for dir in $PATH; do > # use test -x rather than test -f for DJGPP, where test -x checks > # for .exe. But test -x will also return true for directories, so > # explicitly ignore those. > if test -x "$dir/$1" && test ! -d "$dir/$1"; then I see two problems: 1) on a unix-style platforms, if /tmp/etex is a special file (eg. a named pipe) and if /tmp is in PATH, the code will think this is a binary. As you don't remember the path, this problem would only hit if a named pipe existed, while the binary did not. Unlikely. 2) On cygwin, if both $dir/tex.exe exists and a directory $dir/tex/ exist, this function misses the existence of tex.exe. I'm afraid the later can actually happen; so the proposed code would cause problems on Cygwin. I see two possible ways of solution: Fix the problem exactly as reported: the configure script tests for the problem: AC_SUBST(TESTF, "test -f") testfile=conf$$.exe touch $testfile if test -x $testfile; then test -f $testfile || TESTF=: fi rm -f $testfile and use for dir in $PATH; do if test -x "$dir/$1" && @TESTF@ "$dir/$1"; then or testf="@TESTF@" ... for dir in $PATH; do if test -x "$dir/$1" && $testf "$dir/$1"; then in texi2dvi.in . Another way to fix the problem is to adopt the solution used by autoconf: make sure that the variable $ac_executable_extensions, which is set in config.site on some platforms, gets substituted: AC_SUBST(ac_executable_extensions) and put the following to texi2dvi.in: for dir in $PATH; do for exec_ext in '' @ac_executable_extensions@; do if test -f "$dir/$1" && test -x "$dir/$1"; then ... Or you can write configure.ac in a more sofisticated way: AC_SUBST(exeext_for, "") AC_SUBST(exeext_done, "") if test -n "$ac_executable_extensions"; then exeext_for="for exec_ext in '' @ac_executable_extensions@; do" exeext_done=done fi and texi2dvi.in would contain for dir in $PATH; do @exeext_for@ if test -f "$dir/$1" && test -x "$dir/$1"; then ... fi @exeext_done@ done This way would texi2dvi stay simpler on unix-like platforms. (Sorry, Karl, I don't volunteer tro prepare any patch, at least not now. And I don't have any DJGPP or mingw system an hand for debugging.) Have a nice day, Stepan -- 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/