summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2017-04-27 16:18:09 +0200
committerAleksander Mistewicz <a.mistewicz@samsung.com>2017-09-27 18:58:33 +0200
commit6a6074c8133c582af049b30ee28fbff0ae1dd7cb (patch)
tree823b261b3734348377087ebad4dbff871bfd9390
parentbb0f4768566d869109e6cd6df4512c9636425733 (diff)
downloadmajor-6a6074c8133c582af049b30ee28fbff0ae1dd7cb.tar.gz
major-6a6074c8133c582af049b30ee28fbff0ae1dd7cb.tar.bz2
major-6a6074c8133c582af049b30ee28fbff0ae1dd7cb.zip
Fix removal of files from MD5SUMS
Change-Id: I50c60113fcda7a1bd1fc11f188a891ef9f6a500a
-rwxr-xr-xtsp/scripts/download_all.py9
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)