+2004-10-22 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * 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 Пухальский Юрий Андреевич.
+
2004-10-21 Alexandre Duret-Lutz <adl@gnu.org>
* automake.in (get_object_extension): The extension to use is know
#!/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
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.
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
- set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ shift
IFS=$oIFS
pathcomp=
./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
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
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'