aboutsummaryrefslogtreecommitdiffstats
path: root/install-sh
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-12-22 14:28:16 +0200
committerArnold D. Robbins <arnold@skeeve.com>2017-12-22 14:28:16 +0200
commit31964a0f57a269734730a6bc597d4733e1518eb8 (patch)
tree8f4aa2156654c05f0fdb819e726bb18286c67c50 /install-sh
parentb38e210c1b96e7e38bf2e479759f697ccaa006b5 (diff)
parent04235ff1134e404b133917020fa4eac1038947a0 (diff)
downloadegawk-31964a0f57a269734730a6bc597d4733e1518eb8.tar.gz
egawk-31964a0f57a269734730a6bc597d4733e1518eb8.tar.bz2
egawk-31964a0f57a269734730a6bc597d4733e1518eb8.zip
Merge branch 'master' into feature/fix-comments
Diffstat (limited to 'install-sh')
-rwxr-xr-xinstall-sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/install-sh b/install-sh
index 0360b79e..ac159ced 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2017-09-23.17; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -271,15 +271,18 @@ do
fi
dst=$dst_arg
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
+ # If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
- dst=$dstdir/`basename "$src"`
+ dstbase=`basename "$src"`
+ case $dst in
+ */) dst=$dst$dstbase;;
+ *) dst=$dst/$dstbase;;
+ esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
@@ -288,6 +291,11 @@ do
fi
fi
+ case $dstdir in
+ */) dstdirslash=$dstdir;;
+ *) dstdirslash=$dstdir/;;
+ esac
+
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
@@ -427,8 +435,8 @@ do
else
# Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
+ dsttmp=${dstdirslash}_inst.$$_
+ rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0