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 <[email protected]>
---
 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
[email protected]

Reply via email to