]> arthur.barton.de Git - bup.git/blobdiff - t/cleanup-mounts-under
Update base_version to 0.34~ for 0.34 development
[bup.git] / t / cleanup-mounts-under
diff --git a/t/cleanup-mounts-under b/t/cleanup-mounts-under
deleted file mode 100755 (executable)
index 88851e3..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
-exec "$bup_python" "$0" ${1+"$@"}
-"""
-
-import os.path, re, subprocess, sys
-
-def mntent_unescape(x):
-    def replacement(m):
-        unescapes = {
-            "\\\\" : "\\",
-            "\\011" : "\t",
-            "\\012" : "\n",
-            "\\040" : " "
-        }
-        return unescapes.get(m.group(0))
-    return re.sub(r'(\\\\|\\011|\\012|\\040)', replacement, x)
-
-targets = sys.argv[1:]
-exit_status = 0
-for target in targets:
-    if not os.path.isdir(target):
-        print >> sys.stderr, target, 'is not a directory'
-        exit_status = 1
-        continue
-    top = os.path.realpath(target)
-    proc_mounts = open('/proc/mounts', 'r')
-    for line in proc_mounts:
-        _, point, fstype, _ = line.split(' ', 3)
-        point = mntent_unescape(point)
-        if top == point or os.path.commonprefix((top + '/', point)) == top + '/':
-            if fstype.startswith('fuse'):
-                if subprocess.call(['fusermount', '-uz', point]) != 0:
-                    exit_status = 1
-            else:
-                if subprocess.call(['umount', '-l', point]) != 0:
-                    exit_status = 1
-
-sys.exit(exit_status)