From: Alexandre Duret-Lutz Date: Sat, 9 Jul 2005 10:21:12 +0000 (+0000) Subject: * lib/install-sh: Use IFS=/ to split directories on /, don't translate X-Git-Tag: Release-1-9b~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cdfde043ef8d70ab96161b7fcfcb0534278628b;p=thirdparty%2Fautomake.git * lib/install-sh: Use IFS=/ to split directories on /, don't translate / into % as it prevents directory names using %... --- diff --git a/ChangeLog b/ChangeLog index 81834ab14..db0a9f6b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-07-09 Alexandre Duret-Lutz + + * lib/install-sh: Use IFS=/ to split directories on /, don't translate + / into % as it prevents directory names using %... + 2005-07-09 Stepan Kasal * doc/automake.texi (Public macros): Typo. diff --git a/lib/install-sh b/lib/install-sh index 4d4a9519e..f56e14764 100755 --- a/lib/install-sh +++ b/lib/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2005-05-14.22 +scriptversion=2005-07-09.12 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -219,28 +219,28 @@ do # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" - + case $dstdir in + /*) pathcomp=/ ;; + -*) pathcomp=./ ;; + *) pathcomp= ;; + esac oIFS=$IFS - # Some sh's can't handle IFS=/ for some reason. - IFS='%' - set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + IFS=/ + set fnord $dstdir shift IFS=$oIFS - pathcomp= + for d + do + test "x$d" = x && continue - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 - shift + pathcomp=$pathcomp$d if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. - test -d "$pathcomp" || exit + test -d "$pathcomp" || exit 1 fi pathcomp=$pathcomp/ done