Re: [PATCH] Makefile: don't run rm without any files

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Makefile: don't run rm without any files

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:09

Matt Kraai [off-list ref] writes:
I don't set COMPUTE_HEADER_DEPENDENCIES, so it defaults to "auto".
The automatic detection determines that the compiler doesn't support
it, so it's then set to "no".  CHECK_HEADER_DEPENDENCIES isn't set
either, so about 20 lines below the dep_dirs assignment you quoted,
dep_dirs is cleared:

 ifneq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
 ifndef CHECK_HEADER_DEPENDENCIES
 dep_dirs =
 ...

Should I submit an updated patch with a different commit message?
I amended the log message like so:

commit bd9df384b16077337fffe9836c9255976b0e7b91
Author: Matt Kraai [off-list ref]
Date:   Wed Feb 13 07:57:48 2013 -0800

    Makefile: don't run rm without any files
    
    When COMPUTE_HEADER_DEPENDENCIES is set to "auto" and the compiler
    does not support it, $(dep_dirs) becomes empty.  "make clean" runs
    "rm -rf $(dep_dirs)", which fails in such a case.
    
    Signed-off-by: Matt Kraai [off-list ref]
    Signed-off-by: Junio C Hamano [off-list ref]

Re: [PATCH] Makefile: don't run rm without any files

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:56:09

Junio C Hamano wrote:
I amended the log message like so:

commit bd9df384b16077337fffe9836c9255976b0e7b91
Author: Matt Kraai [off-list ref]
Date:   Wed Feb 13 07:57:48 2013 -0800

    Makefile: don't run rm without any files

    When COMPUTE_HEADER_DEPENDENCIES is set to "auto" and the compiler
    does not support it, $(dep_dirs) becomes empty.  "make clean" runs
    "rm -rf $(dep_dirs)", which fails in such a case.
To pedantic, that only fails on some platforms.  The autoconf manual
explains:

	It is not portable to invoke rm without options or operands. On the
	other hand, Posix now requires rm -f to silently succeed when there are
	no operands (useful for constructs like rm -rf $filelist without first
	checking if ‘$filelist’ was empty). But this was not always portable; at
	least NetBSD rm built before 2008 would fail with a diagnostic.

Anyway, looks like a good fix.  Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help