[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fw: bug in texi2dvi, and hack patch
From: |
Eric Blake |
Subject: |
Fw: bug in texi2dvi, and hack patch |
Date: |
Tue, 18 Jan 2005 06:29:08 -0700 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
This was sent to a cygwin list, but is more properly a texinfo problem in
the texi2dvi script (version 4.7). $COMSPEC has meaning in djgpp and
perhaps mingw, but is just a worthless environment variable when inherited
into cygwin. Instead of using $COMSPEC for determining the path
separator, you should use autoconf's approach (look at any recent
configure script generated by autoconf 2.59 for this snippet):
if test "${PATH_SEPARATOR+set}" != set; then
echo "#! /bin/sh" >conf$$.sh
echo "exit 0" >>conf$$.sh
chmod +x conf$$.sh
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -f conf$$.sh
fi
Dave's other point that you are incorrectly dividing the path at ' ' in
findprog() is also valid, you should instead be temporarily setting
IFS=$PATH_SEPARATOR instead. Additionally, according to autoconf, `test
-x' is not portable. Your best bet may be to make texi2dvi a generated
file from texi2dvi.in, and let autoconf determine @PATH_SEPARATOR@ and
even the location of tex up front at configure time, rather than
re-locating it every invocation of texi2dvi.
I was able to avoid hacking texi2dvi by adding "unset COMSPEC" to my
cygwin ~/.bashrc. Even with spaces in my $PATH, tex happened to be
installed in one of the directories that did not have a space.
--
Life is short - so eat dessert first!
Eric Blake address@hidden
To: cygwin at cygwin dot com
From: David Abrahams <dave at boost-consulting dot com>
Subject: bug in texi2dvi, and hack patch
Date: Sat, 15 Jan 2005 13:42:40 -0500
The latest /bin/texi2dvi contains (at line 102):
# Systems which define $COMSPEC or $ComSpec use semicolons to separate
# directories in TEXINPUTS.
if test -n "$COMSPEC$ComSpec"; then
path_sep=";"
else
path_sep=":"
fi
I think I know what this is *trying* to accomplish, but I think it's
misguided. At least on my system, all the environment variables defined
for my NT shell also show up in Cygwin, appropriately translated to use
":" separators. So the above messes everything up when findprog(),
shown below, tries to locate the "tex" program:
findprog () {
foundprog=false
for dir in `echo $PATH | tr "$path_sep" " "`; do
if test -x "$dir/$1"; then # does anyone still need test -f?
foundprog=true
break
fi
done
$foundprog
}
Paths end up being broken at spaces. I'm actually a little concerned
about the code above because it seems to me that even after we fix the
path_sep problem it will fail to work correctly with paths containing
spaces. I'm certain it's not the right long-term fix, but the little
hack patch I needed to get going again was to change line 105 from:
path_sep=";"
to
path_sep=":"
--
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
- Fw: bug in texi2dvi, and hack patch,
Eric Blake <=
- Re: Fw: bug in texi2dvi, and hack patch, Karl Berry, 2005/01/18
- Re: Fw: bug in texi2dvi, and hack patch, Eli Zaretskii, 2005/01/18
- Re: Fw: bug in texi2dvi, and hack patch, Eric Blake, 2005/01/19
- Re: Fw: bug in texi2dvi, and hack patch, Eli Zaretskii, 2005/01/19
- Re: Fw: bug in texi2dvi, and hack patch, Stepan Kasal, 2005/01/20
- Re: Fw: bug in texi2dvi, and hack patch, Karl Berry, 2005/01/20
- Re: Fw: bug in texi2dvi, and hack patch, Stepan Kasal, 2005/01/20
- Re: Fw: bug in texi2dvi, and hack patch, Karl Berry, 2005/01/20
- Re: bug in texi2dvi, and hack patch, Akim Demaille, 2005/01/21
- Re: bug in texi2dvi, and hack patch, Stepan Kasal, 2005/01/21