summaryrefslogtreecommitdiffstats
path: root/bin/ptxdist
diff options
context:
space:
mode:
authorRoland Hieber <rhi@pengutronix.de>2019-11-12 16:38:34 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-11-17 11:31:45 +0100
commit193d52eca375661125fa24888a0cd107df88d478 (patch)
treeefcddc0f006cdb78eb2b9ff4b9de522a93d09cfe /bin/ptxdist
parentaa7dd8cfad4add75efac2aa3a44c50af43f6cadc (diff)
downloadptxdist-193d52eca375661125fa24888a0cd107df88d478.tar.gz
ptxdist-193d52eca375661125fa24888a0cd107df88d478.tar.xz
ptxdist: make 'drop' idempotent with enough --force
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> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'bin/ptxdist')
-rwxr-xr-xbin/ptxdist2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index 25339e1ce..9394b1739 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