]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/m4sugar/m4sh.m4 (AS_MKDIR_P):
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 14 Jan 2004 20:27:30 +0000 (20:27 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 14 Jan 2004 20:27:30 +0000 (20:27 +0000)
Test for dir before calling mkdir -p.  (trivial changes)
* doc/autoconf.texi: Document this.

ChangeLog
doc/autoconf.texi
lib/m4sugar/m4sh.m4

index 957eb3bc4d926b3cabaeb178471c68e0f70d4afb..824da5fd2d24e97ac67433773088a0ece52eccd8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,18 @@
+2004-01-14  Paul Eggert  <eggert@twinsun.com>
+
+       * doc/autoconf.texi (Programming in M4sh): Document that
+       AS_MKDIR_P succeeds if the destination is a symbolic link
+       to an existing directory.
+       (Limitations of Usual Tools): Note that mkdir -p might not
+       succeed on symlinks to directories.
+
 2004-01-13  Paul Hilfinger  <hilfinger@CS.Berkeley.EDU>
 
        * lib/autoconf/autoupdate.m4 (AU_DEFUN): Grammar fix in comment.
        * bin/autoheader.in: Grammar fix in message.
-       (trivial changes)
-       
+       * lib/m4sugar/m4sh.m4 (AS_MKDIR_P):
+       Test for dir before calling mkdir -p.  (trivial changes)
+
 2004-01-13  Eric Blake  <ebb9@byu.net>
 
        * doc/autoconf.texi (Obsolete Macros): In AC_TRY_COMPILE and
index fb5eb89515e4b67ec0cfbc40bbc0ca08fd65e061..dc4b23a9b848a63a7866b0de51ed2244f3d76bcb 100644 (file)
@@ -8547,7 +8547,10 @@ RUN-IF-TRUE or RUN-IF-FALSE is empty.
 Make the directory @var{filename}, including intervening directories
 as necessary.  This is equivalent to @samp{mkdir -p @var{filename}},
 except that it is portable to older versions of @command{mkdir} that
-lack support for the @option{-p} option.
+lack support for the @option{-p} option.  Also, @code{AS_MKDIR_P}
+succeeds if @var{filename} is a symbolic link to an existing directory,
+even though @acronym{POSIX} is unclear whether @samp{mkdir -p} should
+succeed in that case.
 @end defmac
 
 @defmac AS_SET_CATFILE (@var{var}, @var{dir}, @var{file})
@@ -11237,10 +11240,15 @@ found"} if there are no @samp{.c} files.
 @c ------------------
 @prindex @command{mkdir}
 @cindex Making directories
-None of @command{mkdir}'s options are portable.  Instead of
+None of @command{mkdir}'s options are portable to older systems.  Instead of
 @samp{mkdir -p @var{filename}}, you should use use
 @code{AS_MKDIR_P(@var{filename})} (@pxref{Programming in M4sh}).
 
+@acronym{POSIX} does not clearly specify whether @samp{mkdir -p foo}
+should succeed when @file{foo} is a symbolic link to an already-existing
+directory.  GNU Coreutils 5.1.0 @command{mkdir} succeeds, but Solaris 9
+@command{mkdir} fails.
+
 @item @command{mv}
 @c ---------------
 @prindex @command{mv}
index fee5a20858ef6bb34463fa368e1c81048b865cbc..68861d275e112e93f67c218160f2ddb77780bc99 100644 (file)
@@ -788,7 +788,7 @@ fi
 m4_define([AS_MKDIR_P],
 [AS_REQUIRE([_$0_PREPARE])dnl
 { if $as_mkdir_p; then
-    mkdir -p $1
+    test -d $1 || mkdir -p $1
   else
     as_dir=$1
     as_dirs=