projects
/
grml2usb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use the normalized path for unmounting, patch by Peter Daum
[grml2usb.git]
/
grml2usb
diff --git
a/grml2usb
b/grml2usb
index
1cc4521
..
b5338bd
100755
(executable)
--- a/
grml2usb
+++ b/
grml2usb
@@
-18,7
+18,7
@@
from inspect import isroutine, isclass
import datetime, logging, os, re, subprocess, sys, tempfile, time
# global variables
import datetime, logging, os, re, subprocess, sys, tempfile, time
# global variables
-PROG_VERSION = "0.9.
4
"
+PROG_VERSION = "0.9.
5
"
MOUNTED = set() # register mountpoints
TMPFILES = set() # register tmpfiles
DATESTAMP = time.mktime(datetime.datetime.now().timetuple()) # unique identifier for syslinux.cfg
MOUNTED = set() # register mountpoints
TMPFILES = set() # register tmpfiles
DATESTAMP = time.mktime(datetime.datetime.now().timetuple()) # unique identifier for syslinux.cfg
@@
-869,7
+869,7
@@
def unmount(target, unmount_options):
# make sure we unmount only already mounted targets
target_unmount = False
mounts = open('/proc/mounts').readlines()
# make sure we unmount only already mounted targets
target_unmount = False
mounts = open('/proc/mounts').readlines()
- mountstring = re.compile(".*%s.*" % re.escape(
target
))
+ mountstring = re.compile(".*%s.*" % re.escape(
os.path.realpath(target)
))
for line in mounts:
if re.match(mountstring, line):
target_unmount = True
for line in mounts:
if re.match(mountstring, line):
target_unmount = True
@@
-1606,6
+1606,8
@@
def main():
# make sure we have the appropriate permissions
check_uid_root()
# make sure we have the appropriate permissions
check_uid_root()
+ logging.info("Executing grml2usb version %s", PROG_VERSION)
+
if options.dryrun:
logging.info("Running in simulation mode as requested via option dry-run.")
if options.dryrun:
logging.info("Running in simulation mode as requested via option dry-run.")