automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: install-sh uses FYI=/


From: Alexandre Duret-Lutz
Subject: FYI: install-sh uses FYI=/
Date: Sat, 09 Jul 2005 12:20:29 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

I'm installing this on HEAD.
This patch suppresses the '%' and '@%:@' failures in Paul's test.

The "Some sh's can't handle IFS=/ for some reason." comment is
there since install-sh has been added to Automake in 1995, so I
don't know where it comes from.  (It's not in the original X11R5
version.)  I believe this is a myth, and that the author was
probably confused by the fact that some shell might create an
empty word when splitting a string that start with $IFS.

2005-07-09  Alexandre Duret-Lutz  <address@hidden>

        * lib/install-sh: Use IFS=/ to split directories on /, don't translate
        / into % as it prevents directory names using %...

Index: lib/install-sh
===================================================================
RCS file: /cvs/automake/automake/lib/install-sh,v
retrieving revision 1.24
diff -u -r1.24 install-sh
--- lib/install-sh      14 May 2005 20:28:50 -0000      1.24
+++ lib/install-sh      9 Jul 2005 10:15:06 -0000
@@ -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 @@
 
   # 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@/@address@hidden' -e 'address@hidden@/@'`
+    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
-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]