3 bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
4 exec "$bup_python" "$0" ${1+"$@"}
7 import os.path, re, subprocess, sys
9 def mntent_unescape(x):
17 return unescapes.get(m.group(0))
18 return re.sub(r'(\\\\|\\011|\\012|\\040)', replacement, x)
20 targets = sys.argv[1:]
22 for target in targets:
23 if not os.path.isdir(target):
24 print >> sys.stderr, target, 'is not a directory'
27 top = os.path.realpath(target)
28 proc_mounts = open('/proc/mounts', 'r')
29 for line in proc_mounts:
30 _, point, fstype, _ = line.split(' ', 3)
31 point = mntent_unescape(point)
32 if top == point or os.path.commonprefix((top + '/', point)) == top + '/':
33 if fstype.startswith('fuse'):
34 if subprocess.call(['fusermount', '-uz', point]) != 0:
37 if subprocess.call(['umount', '-l', point]) != 0: