summaryrefslogtreecommitdiff
path: root/build-aux/install-sh
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-04-25 12:53:24 +0000
committerKarl Berry <karl@freefriends.org>2006-04-25 12:53:24 +0000
commit5ba0a08be8961606af8648fa3037eb5220d02082 (patch)
tree68bd5750d41f4691a551a9f5ffc63f012a8d668a /build-aux/install-sh
parent607547cc5ced7ad6c5c8a59ceb5635d9546b59ff (diff)
downloadgnulib-5ba0a08be8961606af8648fa3037eb5220d02082.tar.gz
autoupdate
Diffstat (limited to 'build-aux/install-sh')
-rwxr-xr-xbuild-aux/install-sh42
1 files changed, 25 insertions, 17 deletions
diff --git a/build-aux/install-sh b/build-aux/install-sh
index fd2e75a02a..11850a9a9a 100755
--- a/build-aux/install-sh
+++ b/build-aux/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2006-01-12.21
+scriptversion=2006-04-24.12
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -109,7 +109,7 @@ Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
-while test -n "$1"; do
+while test $# -ne 0; do
case $1 in
-c) shift
continue;;
@@ -150,25 +150,33 @@ while test -n "$1"; do
--version) echo "$0 $scriptversion"; exit $?;;
- *) # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- test -n "$dir_arg$dstarg" && break
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dstarg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dstarg"
- shift # fnord
- fi
- shift # arg
- dstarg=$arg
- done
+ --) shift
break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
esac
done
-if test -z "$1"; then
+if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
+fi
+
+if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1