From: Karl Berry Date: Wed, 11 Nov 2020 01:48:35 +0000 (-0800) Subject: install-sh: do not redundantly specify -f to rm. X-Git-Tag: v1.16.3~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5c8d6e25d70ff54b2118c1fc9bfb1a05dbd1de29;p=thirdparty%2Fautomake.git 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. --- 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