changeset 4952:426dd0463e19

update from automake
author Karl Berry <karl@freefriends.org>
date Tue, 17 Feb 2004 00:48:02 +0000
parents 44ce68d044e6
children ee3711b2e4e1
files config/ChangeLog config/install-sh config/mkinstalldirs
diffstat 3 files changed, 24 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2004-02-16  Karl Berry  <karl@gnu.org>
+
+	* mkinstalldirs, install-sh: update from automake.
+
 2004-01-20  Karl Berry  <karl@gnu.org>
 
 	* config.guess: update from config.
--- a/config/install-sh
+++ b/config/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2004-01-13.14
+scriptversion=2004-02-15.20
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -228,7 +228,13 @@
     while test $# -ne 0 ; do
       pathcomp=$pathcomp$1
       shift
-      test -d "$pathcomp" || $mkdirprog "$pathcomp"
+      if test ! -d "$pathcomp"; then
+        $mkdirprog "$pathcomp" || lasterr=$?
+	# 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 ${lasterr-1}); exit; }
+      fi
       pathcomp=$pathcomp/
     done
   fi
--- a/config/mkinstalldirs
+++ b/config/mkinstalldirs
@@ -1,7 +1,7 @@
 #! /bin/sh
 # mkinstalldirs --- make directory hierarchy
 
-scriptversion=2003-11-08.23
+scriptversion=2004-02-15.20
 
 # Original author: Noah Friedman <friedman@prep.ai.mit.edu>
 # Created: 1993-05-16
@@ -66,9 +66,15 @@
   0) exit 0 ;;
 esac
 
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
 case $dirmode in
   '')
-    if mkdir -p -- . 2>/dev/null; then
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
       echo "mkdir -p -- $*"
       exec mkdir -p -- "$@"
     else
@@ -77,16 +83,17 @@
       # directories to create, and then abort because `.' already
       # exists.
       test -d ./-p && rmdir ./-p
-      test -d ./-- && rmdir ./--
+      test -d ./--version && rmdir ./--version
     fi
     ;;
   *)
-    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
       echo "mkdir -m $dirmode -p -- $*"
       exec mkdir -m "$dirmode" -p -- "$@"
     else
       # Clean up after NextStep and OpenStep mkdir.
-      for d in ./-m ./-p ./-- "./$dirmode";
+      for d in ./-m ./-p ./--version "./$dirmode";
       do
         test -d $d && rmdir $d
       done