summaryrefslogtreecommitdiff
path: root/install-sh
diff options
context:
space:
mode:
authorwl <wl>2005-09-04 10:02:23 +0000
committerwl <wl>2005-09-04 10:02:23 +0000
commit8c953ff141461f1d074cd8100d3874ba4bf5f996 (patch)
tree838e0d88483041c70c47fdf528b4e3697f63ab80 /install-sh
parent4d2c472918efb51726b41fd5d9d5f9788916909f (diff)
downloadgroff-8c953ff141461f1d074cd8100d3874ba4bf5f996.tar.gz
* install-sh, mkinstalldirs: New versions; taken from texinfo CVS.groff-1_19_2
Diffstat (limited to 'install-sh')
-rwxr-xr-xinstall-sh30
1 files changed, 15 insertions, 15 deletions
diff --git a/install-sh b/install-sh
index 6ebe46de..f56e1476 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2004-12-17.09
+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
@@ -109,7 +109,7 @@ while test -n "$1"; do
shift
continue;;
- --help) echo "$usage"; exit 0;;
+ --help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2"
shift
@@ -134,7 +134,7 @@ while test -n "$1"; do
shift
continue;;
- --version) echo "$0 $scriptversion"; exit 0;;
+ --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.
@@ -219,28 +219,28 @@ do
# 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@/@%@g' -e 's@^%@/@'`
+ 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