Skip to content

Commit 2337d2f

Browse files
committed
improve sanity checks on deleting tmp dir
1 parent b49320f commit 2337d2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zypperoni

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ from shlex import quote
2929
import xml.etree.ElementTree as ET
3030

3131
# Constants
32-
ZYPPERONI_VERSION = "1.0.5"
32+
ZYPPERONI_VERSION = "1.0.6"
3333
ZYPPER_PID_FILE = "/run/zypp.pid"
3434
ZYPPER_ENV = "ZYPP_CURL2=1 ZYPP_PCK_PRELOAD=1 ZYPP_SINGLE_RPMTRANS=1"
3535

@@ -123,7 +123,7 @@ def recursive_delete(path):
123123
return False
124124
if not path.startswith(tempfile.gettempdir()) or not path.startswith(ZYPPERONI_TMP_DIR):
125125
return False
126-
command = f"rm -r {quote(path)} > /dev/null 2>&1"
126+
command = f"findmnt {quote(path)} > /dev/null 2>&1 || rm -r {quote(path)} > /dev/null 2>&1"
127127
os.system(command)
128128
return True
129129

0 commit comments

Comments
 (0)