From: Stefano Lattarini Date: Wed, 30 Oct 2013 23:17:55 +0000 (+0000) Subject: install-sh: assume that "set -f" and "set +f" work... X-Git-Tag: v1.15~33^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=006ca8d920f41c9bcc157e53e92b420d7a8f162e;p=thirdparty%2Fautomake.git install-sh: assume that "set -f" and "set +f" work... ... and disable/enable shell globbing, respectively. This is mandated by POSIX, and supported even by Solaris 9 /bin/sh (one of the most braindead shells we still support). * lib/install.sh: Adjust. * NEWS: Update. Signed-off-by: Stefano Lattarini --- diff --git a/NEWS b/NEWS index 37f513bc6..da41307e0 100644 --- a/NEWS +++ b/NEWS @@ -109,9 +109,11 @@ New in 1.15: * Cleanups and modernizations: - The install-sh script has been modernized, and now makes the following - assumptions unconditionally: + assumptions *unconditionally*: (1) a working 'dirname' program is available; (2) the ${var:-value} shell parameters substitution works; + (3) the "set -f" and "set +f" shell commands work, and, respectively, + disable and enable shell globbing. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/install-sh b/lib/install-sh index 9a7bad82f..be3c5d94c 100755 --- a/lib/install-sh +++ b/lib/install-sh @@ -63,17 +63,6 @@ mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -365,14 +354,12 @@ do *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= @@ -443,13 +430,10 @@ do if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then