* morituri/common/program.py:

* morituri/rip/offset.py:
	  When finding the offset, also load and possibly unmount, resolving
	  to the real path for the device.
This commit is contained in:
Thomas Vander Stichele
2011-03-22 17:31:36 +00:00
parent 82edb39c03
commit 6a8355b109
3 changed files with 22 additions and 2 deletions

View File

@@ -189,7 +189,11 @@ class Program(log.Loggable):
"""
Unmount the given device if it is mounted, as happens with automounted
data tracks.
If the given device is a symlink, the target will be checked.
"""
device = os.path.realpath(device)
self.debug('possibly unmount real path %r' % device)
proc = open('/proc/mounts').read()
if device in proc:
print 'Device %s is mounted, unmounting' % device