[PATCH 1/4] {minor} install-sh: assume 'dirname' is available and working correctly

Stefano Lattarini <[email protected]>
Newsgroups gmane.comp.sysutils.automake.patches
Message-ID <1b61da332734264141cb7500ee8c68d0927c72fa.1383264207.git.stefano.lattarini@gmail.com>
Really, we no longer care about hosts so outdated/broken to miss
fundamental utilities like basename or dirname.

* lib/install.sh: Adjust.
* NEWS, THANKS: Update.

Suggested-by: Philipp A. Hartmann <[email protected]>
Signed-off-by: Stefano Lattarini <[email protected]>
---
 NEWS           |  9 +++++++++
 THANKS         |  1 +
 lib/install-sh | 30 ++----------------------------
 3 files changed, 12 insertions(+), 28 deletions(-)

diff --git a/NEWS b/NEWS
index aaec7c0..50f1e7f 100644
--- a/NEWS
+++ b/NEWS
@@ -104,6 +104,15 @@
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+New in 1.15:
+
+* Cleanups and modernizations:
+
+  - The install-sh script now unconditionally assumes that a working
+    'dirname' program is available.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
 New in 1.14.1:
 
 * Bugs fixed:
diff --git a/THANKS b/THANKS
index 6be803e..e4f70f3 100644
--- a/THANKS
+++ b/THANKS
@@ -328,6 +328,7 @@ Phil Edwards                    [email protected]
 Phil Nelson                     [email protected]
 Philip Fong                     [email protected]
 Philip S Tellis                 [email protected]
+Philipp A. Hartmann             [email protected]
 Пухальский Юрий Андреевич       [email protected]
 Quentin Glidic                  [email protected]
 Rainer Orth                     [email protected]
diff --git a/lib/install-sh b/lib/install-sh
index 377bb86..f950f30 100755
--- a/lib/install-sh
+++ b/lib/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2011-11-20.07; # UTC
+scriptversion=2013-10-30.23; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -277,33 +277,7 @@ do
       dst=$dstdir/`basename "$src"`
       dstdir_status=0
     else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-	(dirname "$dst") 2>/dev/null ||
-	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	     X"$dst" : 'X\(//\)[^/]' \| \
-	     X"$dst" : 'X\(//\)$' \| \
-	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-	echo X"$dst" |
-	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)[^/].*/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\).*/{
-		   s//\1/
-		   q
-		 }
-		 s/.*/./; q'
-      `
-
+      dstdir=`dirname "$dst"`
       test -d "$dstdir"
       dstdir_status=$?
     fi
-- 
1.8.3.1.605.g85318f5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.