Fix progress reporting

This commit is contained in:
Aurélien Gâteau 2014-07-30 15:35:51 +02:00
parent f371ffa696
commit 8867f6bc67

View File

@ -125,6 +125,10 @@ class UnsquashOperation:
shutil.rmtree(source_mount_path)
def unsquash_image(self, entry, imgmountdir):
def progress_cb(copied):
self.unpackstatus[entry.source].copied = copied
self.report_progress()
subprocess.check_call(["mount",
entry.source,
imgmountdir,
@ -132,7 +136,7 @@ class UnsquashOperation:
try:
file_copy(imgmountdir,
entry.destination,
self.report_progress)
progress_cb)
finally:
subprocess.check_call(["umount", "-l", imgmountdir])