]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* lib/install-sh: Use IFS=/ to split directories on /, don't translate
authorAlexandre Duret-Lutz <adl@gnu.org>
Sat, 9 Jul 2005 10:21:12 +0000 (10:21 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sat, 9 Jul 2005 10:21:12 +0000 (10:21 +0000)
/ into % as it prevents directory names using %...

ChangeLog
lib/install-sh

index 81834ab143f1933a9d58a5100463196e59e680ba..db0a9f6b6def4fa7b61ee85dd8f2a6c6e6ce29eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-09  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * lib/install-sh: Use IFS=/ to split directories on /, don't translate
+       / into % as it prevents directory names using %...
+
 2005-07-09  Stepan Kasal  <kasal@ucw.cz>
 
        * doc/automake.texi (Public macros): Typo.
index 4d4a9519eaf88b18fb157dfe5fae59c1c5d005c7..f56e147640dc843b1fafa0639dea583c1c309496 100755 (executable)
@@ -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