diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-10-30 23:17:55 +0000 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-10-30 23:17:55 +0000 |
commit | 006ca8d920f41c9bcc157e53e92b420d7a8f162e (patch) | |
tree | fe2dfeafc2f0fc241e56b1917b557c75bc5c3c76 | |
parent | bd44db1abdeea3643ba0387de24af7539da644e4 (diff) | |
download | automake-006ca8d920f41c9bcc157e53e92b420d7a8f162e.tar.gz |
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 <stefano.lattarini@gmail.com>
-rw-r--r-- | NEWS | 4 | ||||
-rwxr-xr-x | lib/install-sh | 24 |
2 files changed, 7 insertions, 21 deletions
@@ -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 |