diff options
-rwxr-xr-x | tsp/scripts/download_all.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tsp/scripts/download_all.py b/tsp/scripts/download_all.py index a2a67a7..4bc391d 100755 --- a/tsp/scripts/download_all.py +++ b/tsp/scripts/download_all.py @@ -236,9 +236,14 @@ class Downloader(threading.Thread): else: logging.warn("Checksum FAILED\nRemoving files mentioned in md5sums file") with open(md5_path, 'r') as f: - for i in f: + for line in f: try: - os.remove(self.name + "/" + i) + filename = line.split(' ') + if len(filename) != 2: + logging.warn("Unexpected number of substrings [%d]: %s", + len(filename), line) + break + os.remove(self.name + "/" + filename[1]) except OSError as e: logging.warn("rm: %s" % e.strerror) os.remove(md5_path) |