From: Alexander Kriegisch <Alexander@Kriegisch.name>
To: buildroot@busybox.net
Subject: [Buildroot] usage of '-rm -f ...' in .mk files
Date: Tue, 09 Oct 2007 02:03:17 +0200 [thread overview]
Message-ID: <470AC545.5070605@Kriegisch.name> (raw)
In-Reply-To: <0710090011020.20512@somehost>
> Isn't it so that we want to know if an attempt to remove unremovable
> files occurs, instead of ignoring errors by using '-rm -f'?
I would say it depends on the situation. Normally the inability to
remove files during a cleanup might not be considered worthy of turining
into a show-stopper for the whole make process. In other cases that
might well be so, and I guess it should be up to the developer writing
the makefile to decide if she wants a possible error printed, but
continue with whatever target is being built, or if she regards a failed
unlink severe enough to yield an error.
Having said that, I concede that "rm -f" usually does not exit with an
error anyway, thus rendering "-rm -f" kind of useless. But on the other
hand, double safety never hurts, and explicit coding helps understand
what the author intends with a certain line of code. The leading dash is
a clear statement saying "whatever happens, go on". Furthermore, there
might be improbable cases in which a certain "rm" implementation might
yield an error anyway. Given the fact that Busybox sometimes is very
terse in error handling, leaving out improbable error conditions in
order to save space, I would not say that an error during "rm -f" is
absolutely impossible. I have not looked into the source code, though.
Regards
--
Alexander Kriegisch
prev parent reply other threads:[~2007-10-09 0:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-08 22:28 [Buildroot] usage of '-rm -f ...' in .mk files Cristian Ionescu-Idbohrn
2007-10-09 0:03 ` Alexander Kriegisch [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=470AC545.5070605@Kriegisch.name \
--to=alexander@kriegisch.name \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.