[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gettext] Sync the code for determining PATH_SEPARATOR with the one
From: |
Stefano Lattarini |
Subject: |
[bug-gettext] Sync the code for determining PATH_SEPARATOR with the one in Autoconf |
Date: |
Fri, 21 Dec 2012 13:33:54 +0100 |
Both in the 'autopoint' and 'gettextize' scripts, in the code of the
'func_find_curr_installdir' function, I see that the following code is
used to determine the value of the PATH_SEPARATOR variable:
func_tmpdir
{ echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh
chmod +x "$tmp"/conf.sh
if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -rf "$tmp"
I think it might be nice to rewrite this code so that it doesn't touch
the file system, the same way it's done by modern Autoconf (a way that
is also used by gettext own file 'gettext-runtime/m4/progtest.m4' BTW):
# Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
# contains only /bin. Note that ksh looks also at the FPATH variable,
# so we have to set that as well for the test.
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
&& { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|| PATH_SEPARATOR=';'
}
Of course, this is something to consider for the 1.19 release, rather
than for the soon-to-come 1.18.2.
Regards,
Stefano
- [bug-gettext] Sync the code for determining PATH_SEPARATOR with the one in Autoconf,
Stefano Lattarini <=