]> git.ipfire.org Git - thirdparty/automake.git/commit
rm: handle -f w/no arguments gracefully
authorMike Frysinger <vapier@gentoo.org>
Thu, 17 Feb 2022 08:50:55 +0000 (03:50 -0500)
committerMike Frysinger <vapier@gentoo.org>
Mon, 21 Feb 2022 00:57:40 +0000 (19:57 -0500)
commit3099097d74c96bbb30aa38233091f96634eda27a
treeccbfc36511854bed963a6d21495b0acf460babcd
parent31237ca48d1ec04c8498312aa7e3e5b5174a37d6
rm: handle -f w/no arguments gracefully

Fixes automake bug https://bugs.gnu.org/10828.

Delete the configure check that would abort if `rm -f` does not work,
and delete the plans to make this a hard requirement in the future.

Instead, test to see if `rm -f` fails w/out arguments.  If it does,
define am__rm_f such that it always passes at least the "" argument
when deleting files.  If it doesn't fail, then we can omit the "".

Then go through lib/am/ and update places where we use the pattern
`test -z ... || rm -f ...` and replace with $(am__rm_f).

* NEWS: Mention support for `rm -f` w/out arguments.
* PLANS/rm-f-without-args.txt: Remove.
* lib/am/check.am: Use new $(am__rm_f) helper.
* lib/am/clean.am: Likewise.
* lib/am/header-vars.am: Likewise.
* lib/am/inst-vars.am: Likewise.
* lib/am/libs.am: Likewise.
* lib/am/ltlib.am: Likewise.
* lib/am/progs.am: Likewise.
* lib/am/texinfos.am: Likewise.
* m4/init.m4: Delete `rm -f` checks and call _AM_PROG_RM_F.
* m4/rmf.m4: Define new _AM_PROG_RM_F macro.
* t/rm-f-probe.sh: Update test.
13 files changed:
NEWS
PLANS/rm-f-without-args.txt [deleted file]
lib/am/check.am
lib/am/clean.am
lib/am/header-vars.am
lib/am/inst-vars.am
lib/am/libs.am
lib/am/ltlib.am
lib/am/progs.am
lib/am/texinfos.am
m4/init.m4
m4/rmf.m4 [new file with mode: 0644]
t/rm-f-probe.sh