From: Roland Hieber <rhi@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Roland Hieber <rhi@pengutronix.de>
Subject: [ptxdist] [PATCH] ptxdist: make 'drop' idempotent with enough --force
Date: Tue, 12 Nov 2019 16:38:34 +0100 [thread overview]
Message-ID: <20191112153834.21653-1-rhi@pengutronix.de> (raw)
This should make 'drop' suitable for use in a scripting environment,
e.g. equivalent to 'rm --force'. In this case, the following rm is
actually a no-op, but the message after that is useful nevertheless.
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
bin/ptxdist | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/ptxdist b/bin/ptxdist
index 25339e1cec19..9394b1739190 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -1217,7 +1217,7 @@ drop() {
fi
echo
- if [ -e "${STATEDIR}/${statefile}" ]; then
+ if [ -e "${STATEDIR}/${statefile}" -o -n "${PTXDIST_FORCE}" ] ; then
rm -f -- "${STATEDIR}/${statefile}"
echo "dropping ${statefile}"
echo
--
2.24.0.rc1
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
reply other threads:[~2019-11-12 15:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20191112153834.21653-1-rhi@pengutronix.de \
--to=rhi@pengutronix.de \
--cc=ptxdist@pengutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox