summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-11-10 17:48:35 -0800
committerKarl Berry <karl@freefriends.org>2020-11-10 17:48:35 -0800
commit5c8d6e25d70ff54b2118c1fc9bfb1a05dbd1de29 (patch)
tree3661b85b2faba43ff6d687375310b0566e317a9c
parent782ac4008559afe5adceac5dcd7d8614dc5689af (diff)
downloadautomake-5c8d6e25d70ff54b2118c1fc9bfb1a05dbd1de29.tar.gz
install-sh: do not redundantly specify -f to rm.
* 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.
-rw-r--r--NEWS3
-rwxr-xr-xlib/install-sh7
2 files changed, 8 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 010cd3756..c7d02d606 100644
--- 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.
diff --git a/lib/install-sh b/lib/install-sh
index b34a8fc5a..2915ff015 100755
--- a/lib/install-sh
+++ b/lib/install-sh
@@ -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