summaryrefslogtreecommitdiff
path: root/update-sha1sums.py
diff options
context:
space:
mode:
authorLuK1337 <priv.luk@gmail.com>2018-01-09 00:59:02 +0100
committerIsaac Chen <tingyi364@gmail.com>2019-11-05 13:15:54 +0100
commit93bc63ba8d2ae6845e89551664c4916a60ca225c (patch)
tree4510b358ee36bcfb91445f47d3bfa476119c4498 /update-sha1sums.py
parent848cdef9ed4e0fc4dc0974c2cbb98798e300b9a5 (diff)
sdm660-common: Handle moved blobs in update-sha1sums.py script
Change-Id: Iccab8c8620c7ff680768aac2d9cbf5b5067af8d7
Diffstat (limited to 'update-sha1sums.py')
-rwxr-xr-xupdate-sha1sums.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/update-sha1sums.py b/update-sha1sums.py
index b22c516..b51c159 100755
--- a/update-sha1sums.py
+++ b/update-sha1sums.py
@@ -41,11 +41,12 @@ for index, line in enumerate(lines):
if needSHA1:
# Remove existing SHA1 hash
line = line.split('|')[0]
+ filePath = line.split(':')[1] if len(line.split(':')) == 2 else line
- if line[0] == '-':
- file = open('%s/%s' % (vendorPath, line[1:]), 'rb').read()
+ if filePath[0] == '-':
+ file = open('%s/%s' % (vendorPath, filePath[1:]), 'rb').read()
else:
- file = open('%s/%s' % (vendorPath, line), 'rb').read()
+ file = open('%s/%s' % (vendorPath, filePath), 'rb').read()
hash = sha1(file).hexdigest()
lines[index] = '%s|%s\n' % (line, hash)