INN commit: branches/2.6/support (install-sh)

INN Commit rra at isc.org
Tue Jan 23 21:05:13 UTC 2018


    Date: Tuesday, January 23, 2018 @ 13:05:12
  Author: iulius
Revision: 10227

Update to latest install-sh upstream version

Do not append / to destination
directory if it already ends in /.  This supports
a destination directory of // on hosts where / and //
are distinct directories, as POSIX allows.

Modified:
  branches/2.6/support/install-sh

------------+
 install-sh |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

Modified: install-sh
===================================================================
--- install-sh	2018-01-23 21:04:40 UTC (rev 10226)
+++ install-sh	2018-01-23 21:05:12 UTC (rev 10227)
@@ -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
 
 #############################
 # NOTICE TO INN MAINTAINERS #
@@ -300,8 +300,7 @@
     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
@@ -308,7 +307,11 @@
         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"`
@@ -317,6 +320,11 @@
     fi
   fi
 
+  case $dstdir in
+    */) dstdirslash=$dstdir;;
+    *)  dstdirslash=$dstdir/;;
+  esac
+
   obsolete_mkdir_used=false
 
   if test $dstdir_status != 0; then
@@ -456,8 +464,8 @@
   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



More information about the inn-committers mailing list