[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make install using "-j"

From: Ralf Wildenhues
Subject: Re: make install using "-j"
Date: Wed, 21 Jun 2006 21:34:41 +0200
User-agent: Mutt/1.5.11+cvs20060403

[ ]


* Quoting myself:
> [...] removes the special-casing of the `mkdir' for the last component
> of `install-sh -d'.  However, the ChangeLog entry is way too terse [...]

I propose this ChangeLog change:

--- ChangeLog   7 Jun 2006 06:01:22 -0000       1.2901
+++ ChangeLog   21 Jun 2006 19:20:32 -0000
@@ -506,10 +506,12 @@
 2005-09-13  Paul Eggert  <address@hidden>
        * doc/automake.texi (limitations on file names): New section.
        * lib/install-sh: Rewrite to support '*' in file names.
        Also, tune so that we don't invoke so many commands in the usual case.
+       Also, fix `install-sh -d' to not fail if it loses the race in creating
+       the last path component against another process.
        * tests/instspc.test: The "*" test is now fixed.
 2005-09-13  Stepan Kasal  <address@hidden>
        * (Languages) <cppasm>: Fix typo in the comment.


> | gmake[2]: Entering directory `/tmp/build/j4-3/_build'
> | test -z "/tmp/build/j4-3/_inst/etc" || /tmp/build/j4-3/install-sh -d 
> "/tmp/build/j4-3/_inst/etc"
> |  /tmp/build/j4-3/install-sh -c -m 644 '../a/b/c/d/e/file1' 
> '/tmp/build/j4-3/_inst/etc/a/b/c/d/e/file1'
> | mkdir: cannot create /tmp/build/j4-3/_inst/etc/a/b: Permission denied
> This is due to a bug in HP-UX mkdir that install-sh doesn't detect yet.
> With a umask of 002,
> $ mkdir -m u=rwx,g=rx,o=rx -p -- foo/bar
> creates foo as 'drwxr-xr-x' (note the missing g+w! foo), and what's worse,
> $ mkdir -m u=rwx,g=rx,o=rx,u+wx -p -- foo/bar
> creates foo as 'd-wx-w--w-', and exits successfully.

The patch below detects the second failure in install-sh.
Seems install-sh ever gets slower and slower...

Some comments:
- the rmdir of _insh.$$_/sub also seems to work without the chmod, but
  if I understand Posix correctly, rmdir may require search permissions
  on directory path components in addition to the write access to the
  parent directory.  And I wanted to play safe here...
- I'm unsure whether _insh.$$_ is actually ok as portable file name.
- the first failure (to use `umask` as mode, rather than taking the
  argument of `-m' into account) isn't fixed by the patch below.

Maybe an addition to the Autoconf manual would be good, too, but I'm too
exhausted to analyze this failure further right now, and we already have
a general warning in place that none of mkdir's options are portable.

OK to apply (including updating $scriptversion)?
Not sure about an easy way to fix the first bug as well here.


        * lib/install-sh: HP-UX 11.23 `mkdir -m u=rwx,[...],u+wx -p'
        may exit 0 but create intermediate directories with bogus
        permissions.  So change the `$mkdirprog -m $test_mode' test to
        create actual directories, and test for readability of the
        intermediate one.  Clean up afterwards.

Index: lib/install-sh
RCS file: /cvs/automake/automake/lib/install-sh,v
retrieving revision 1.34
diff -u -r1.34 install-sh
--- lib/install-sh      11 May 2006 19:52:08 -0000      1.34
+++ lib/install-sh      21 Jun 2006 19:32:53 -0000
@@ -275,12 +275,14 @@
     case $posix_mkdir in
-       if $mkdirprog -m $test_mode -p -- / >/dev/null 2>&1; then
+       if $mkdirprog -m $test_mode -p -- _insh.$$_/sub >/dev/null 2>&1 &&
+          test -r _insh.$$_; then
-       else
-         # Remove any dirs left behind by ancient mkdir implementations.
-         rmdir ./-m "$test_mode" ./-p ./-- 2>/dev/null
-       fi ;;
+       fi
+       # Remove any dirs left behind by good and ancient mkdir implementations.
+       chmod 700 _insh.$$_
+       rmdir _insh.$$_/sub _insh.$$_ ./-m "$test_mode" ./-p ./-- 2>/dev/null
+       ;;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]