Regenerate.

This commit is contained in:
Paul Eggert
2004-02-02 22:52:54 +00:00
parent dd0e0635ec
commit 0b31edd3e1

View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# install - install a program, script, or datafile # install - install a program, script, or datafile
scriptversion=2003-09-24.23 scriptversion=2004-01-12.10
# This originates from X11R5 (mit/util/scripts/install.sh), which was # This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the # later released in X11R6 (xc/config/util/install.sh) with the
@@ -72,7 +72,8 @@ dst=
dir_arg= dir_arg=
usage="Usage: $0 [OPTION]... SRCFILE DSTFILE usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
or: $0 -d DIR1 DIR2... or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 -d DIRECTORIES...
In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
In the second, create the directory path DIR. In the second, create the directory path DIR.
@@ -134,23 +135,35 @@ while test -n "$1"; do
--version) echo "$0 $scriptversion"; exit 0;; --version) echo "$0 $scriptversion"; exit 0;;
*) if test -z "$src"; then *) # When -d is used, all remaining arguments are directories to create.
src=$1 test -n "$dir_arg" && break
else # Otherwise, the last argument is the destination. Remove it from $@.
# this colon is to work around a 386BSD /bin/sh bug for arg
: do
dst=$1 if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi fi
shift shift # arg
continue;; dstarg=$arg
done
break;;
esac esac
done done
if test -z "$src"; then if test -z "$1"; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2 echo "$0: no input file specified." >&2
exit 1 exit 1
fi fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
for src
do
# Protect names starting with `-'. # Protect names starting with `-'.
case $src in case $src in
-*) src=./$src ;; -*) src=./$src ;;
@@ -175,11 +188,12 @@ else
exit 1 exit 1
fi fi
if test -z "$dst"; then if test -z "$dstarg"; then
echo "$0: no destination specified." >&2 echo "$0: no destination specified." >&2
exit 1 exit 1
fi fi
dst=$dstarg
# Protect names starting with `-'. # Protect names starting with `-'.
case $dst in case $dst in
-*) dst=./$dst ;; -*) dst=./$dst ;;
@@ -280,7 +294,8 @@ else
# Now rename the file to the real destination. # Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile" $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi && fi || { (exit 1); exit; }
done
# The final little trick to "correctly" pass the exit status to the exit trap. # The final little trick to "correctly" pass the exit status to the exit trap.
{ {