diff --git a/src/modules/unsquashfs/filecopy.py b/src/modules/unsquashfs/filecopy.py index e97ef660b..8ca84255b 100644 --- a/src/modules/unsquashfs/filecopy.py +++ b/src/modules/unsquashfs/filecopy.py @@ -26,14 +26,12 @@ import os import subprocess import re -from threading import Thread - COPY_CMD = 'rsync -ar --progress %(source)s %(dest)s' ON_POSIX = 'posix' in sys.builtin_module_names -class FileCopyThread( Thread ): +class FileCopy: """ Update the value of the progress bar so that we get some movement """ def __init__( self, source, dest, progress_cb ): # Environment used for executing rsync properly @@ -54,13 +52,6 @@ class FileCopyThread( Thread ): self.progress_cb = progress_cb - super( FileCopyThread, self ).__init__() - - - def kill( self ): - if self.process.poll() is None: - self.process.kill() - def run( self ): num_files_copied = 0 diff --git a/src/modules/unsquashfs/main.py b/src/modules/unsquashfs/main.py index 043d66ff1..742f3d38e 100644 --- a/src/modules/unsquashfs/main.py +++ b/src/modules/unsquashfs/main.py @@ -22,7 +22,7 @@ import subprocess import tempfile from libcalamares import * -from filecopy import FileCopyThread +from filecopy import FileCopy class UnsquashOperation: @@ -81,9 +81,8 @@ class UnsquashOperation: try: subprocess.check_call( [ "mount", entry[ "source" ], entry[ "sourceDir" ], "-t", "squashfs", "-o", "loop" ] ) - t = FileCopyThread( entry[ "sourceDir" ], entry[ "destination" ], self.reportProgress ) - t.start() - t.join() + t = FileCopy( entry[ "sourceDir" ], entry[ "destination" ], self.reportProgress ) + t.run() finally: subprocess.check_call( [ "umount", "-l", entry[ "sourceDir" ] ] )