diff options
author | Karl Berry <karl@freefriends.org> | 2020-11-10 17:48:35 -0800 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-11-10 17:48:35 -0800 |
commit | 5c8d6e25d70ff54b2118c1fc9bfb1a05dbd1de29 (patch) | |
tree | 3661b85b2faba43ff6d687375310b0566e317a9c | |
parent | 782ac4008559afe5adceac5dcd7d8614dc5689af (diff) | |
download | automake-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-- | NEWS | 3 | ||||
-rwxr-xr-x | lib/install-sh | 7 |
2 files changed, 8 insertions, 2 deletions
@@ -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 |