bug-automake
[Top][All Lists]
Advanced

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

Re: install-sh problem


From: Alexandre Duret-Lutz
Subject: Re: install-sh problem
Date: Fri, 22 Oct 2004 08:44:54 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Howdy,

>>> "Пух" == Пухальский Юрий Андреевич <address@hidden> writes:

 Пух> Not sure if it concerns automake, but as of 1.9.2 the
 Пух> following problem occurs.  We invoke $(mkinstalldirs) to
 Пух> create directory, which name ends with '/', when
 Пух> mkinstalldirs is configured to "install-sh -d". It tries
 Пух> to make the directory twice, and fails on second try with
 Пух> "already exists" message. When directory name is without
 Пух> trailing slash, everything works ok.

Good catch, thanks.  I'm installing the following fix.


2004-10-22  Alexandre Duret-Lutz  <address@hidden>

        * lib/install-sh: Fix the dirname emulation to ignore trailing
        slashes, i.e., the direname of `a/b/' is `a', not `a/b/'.  This
        caused `install-sh a/b/' to fail.
        * tests/instsh2.test: Augment.
        Report from Пухальский Юрий Андреевич.

Index: lib/install-sh
===================================================================
RCS file: /cvs/automake/automake/lib/install-sh,v
retrieving revision 1.19.2.1
diff -u -r1.19.2.1 install-sh
--- lib/install-sh      10 Sep 2004 18:47:55 -0000      1.19.2.1
+++ lib/install-sh      21 Oct 2004 22:31:47 -0000
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2004-09-10.20
+scriptversion=2004-10-22.00
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -213,7 +213,7 @@
   fi
 
   # This sed command emulates the dirname command.
-  dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
 
   # Make sure that the destination directory exists.
 
@@ -226,7 +226,8 @@
     oIFS=$IFS
     # Some sh's can't handle IFS=/ for some reason.
     IFS='%'
-    set - `echo "$dstdir" | sed -e 's@/@address@hidden' -e 'address@hidden@/@'`
+    set x `echo "$dstdir" | sed -e 's@/@address@hidden' -e 'address@hidden@/@'`
+    shift
     IFS=$oIFS
 
     pathcomp=
Index: tests/instsh2.test
===================================================================
RCS file: /cvs/automake/automake/tests/instsh2.test,v
retrieving revision 1.4
diff -u -r1.4 instsh2.test
--- tests/instsh2.test  5 Jul 2004 07:07:55 -0000       1.4
+++ tests/instsh2.test  21 Oct 2004 22:31:47 -0000
@@ -37,10 +37,15 @@
 ./install-sh -d d0
 test -d d0
 # Multiple directories (for make installdirs).
-./install-sh -d d1 d2 d3
+./install-sh -d d1 d2 d3 d4
 test -d d1
 test -d d2
 test -d d3
+test -d d4
+# Subdirectories
+./install-sh -d p1/p2/p3 p4//p5//p6//
+test -d p1/p2/p3
+test -d p4/p5/p6
 
 # Files.
 : > x
@@ -56,7 +61,7 @@
 test -f z
 test -f d1/x
 test -f d1/z
-./install-sh -m 644 x z d2
+./install-sh -m 644 x z d2//
 test -f x
 test -f z
 test -f d2/x
@@ -66,10 +71,16 @@
 test -f z
 test -f d3/x
 test -f d3/z
+./install-sh -t d4// -m 644 x z
+test -f x
+test -f z
+test -f d4/x
+test -f d4/z
 ./install-sh -T x d3/y
 test -f x
 test -f d3/y
 ./install-sh -T x d3 && exit 1
+./install-sh -T x d4// && exit 1
 
 # Ensure that install-sh works with names that include spaces
 touch 'a b'


-- 
Alexandre Duret-Lutz





reply via email to

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