* [ptxdist] [PATCH] ptxdist: make 'drop' idempotent with enough --force
@ 2019-11-12 15:38 Roland Hieber
0 siblings, 0 replies; only message in thread
From: Roland Hieber @ 2019-11-12 15:38 UTC (permalink / raw)
To: ptxdist; +Cc: Roland Hieber
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-11-12 15:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12 15:38 [ptxdist] [PATCH] ptxdist: make 'drop' idempotent with enough --force Roland Hieber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox