Re: [PATCH] install-sh: prevent existing directories from being chown'ed

Karl Berry <[email protected]>
Newsgroups gmane.comp.sysutils.automake.patches
Message-ID <[email protected]>
    https://lists.gnu.org/archive/html/automake-patches/2018-03/msg00003.html

I pushed the change from here as below, plus a mention in NEWS. Since
the --help message already says that chown applies to "installed files",
and an existing directory is not "installed", I didn't think it needed
any additional doc. --thanks, karl.

index 2915ff0..4fe1350 100755
--- a/lib/install-sh
+++ b/lib/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile

-scriptversion=2020-07-26.22; # UTC
+scriptversion=2020-11-11.01; # UTC

 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -262,6 +262,10 @@ do
     dstdir=$dst
     test -d "$dstdir"
     dstdir_status=$?
+    # Don't chown directories that already exist.
+    if test $dstdir_status = 0; then
+      chowncmd=""
+    fi
   else

     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command

compile finished at Tue Nov 10 17:54:06 2020
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.