diff options
author | Roland Hieber <rhi@pengutronix.de> | 2019-11-12 16:38:34 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-11-17 11:31:45 +0100 |
commit | 193d52eca375661125fa24888a0cd107df88d478 (patch) | |
tree | efcddc0f006cdb78eb2b9ff4b9de522a93d09cfe /bin | |
parent | aa7dd8cfad4add75efac2aa3a44c50af43f6cadc (diff) | |
download | ptxdist-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')
-rwxr-xr-x | bin/ptxdist | 2 |
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 |