]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
install-sh: do not redundantly specify -f to rm.
authorKarl Berry <karl@freefriends.org>
Wed, 11 Nov 2020 01:48:35 +0000 (17:48 -0800)
committerKarl Berry <karl@freefriends.org>
Wed, 11 Nov 2020 01:48:35 +0000 (17:48 -0800)
* lib/install-sh: do not redundantly specify -f to rm.
Mention implication for RMPROG in the --help message.
Original patch sent by Julien Elie:
https://lists.gnu.org/archive/html/automake-patches/2018-03/msg00005.html
* NEWS: mention this.

NEWS
lib/install-sh

diff --git a/NEWS b/NEWS
index 010cd37564d7a335e2a10ed6a9ea583885fd5ce7..c7d02d606c19eb747165c8ad8be7e25f40a758d8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -92,6 +92,9 @@ New in ?.?.?:
 
 * Miscellaneous changes
 
+  - install-sh no longer unconditionally uses -f when rm is overridden
+  by RMPROG.
+
   - Removed function up_to_date_p in lib/Automake/FileUtils.pm.
     We believe this function is completely unused.
 
index b34a8fc5ab97ce3559beb316a787d6b2be723fbd..2915ff0158366366ed7eb5dd87131b7cca547000 100755 (executable)
@@ -115,6 +115,9 @@ Options:
 Environment variables override the default commands:
   CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
   RMPROG STRIPPROG
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
 "
 
 while test $# -ne 0; do
@@ -487,9 +490,9 @@ do
         # file should still install successfully.
         {
           test ! -f "$dst" ||
-          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          $doit $rmcmd "$dst" 2>/dev/null ||
           { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+            { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
           } ||
           { echo "$0: cannot unlink or rename $dst" >&2
             (exit 1); exit 1