mirror of
https://github.com/LineageOS/android_device_xiaomi_whyred.git
synced 2025-10-05 02:39:49 +02:00
whyred: Handle moved blobs in update-sha1sums.py script
Change-Id: Iccab8c8620c7ff680768aac2d9cbf5b5067af8d7
This commit is contained in:
parent
02fe57dbc1
commit
093d4fe91a
1 changed files with 4 additions and 3 deletions
|
@ -41,11 +41,12 @@ for index, line in enumerate(lines):
|
||||||
if needSHA1:
|
if needSHA1:
|
||||||
# Remove existing SHA1 hash
|
# Remove existing SHA1 hash
|
||||||
line = line.split('|')[0]
|
line = line.split('|')[0]
|
||||||
|
filePath = line.split(':')[1] if len(line.split(':')) == 2 else line
|
||||||
|
|
||||||
if line[0] == '-':
|
if filePath[0] == '-':
|
||||||
file = open('%s/%s' % (vendorPath, line[1:]), 'rb').read()
|
file = open('%s/%s' % (vendorPath, filePath[1:]), 'rb').read()
|
||||||
else:
|
else:
|
||||||
file = open('%s/%s' % (vendorPath, line), 'rb').read()
|
file = open('%s/%s' % (vendorPath, filePath), 'rb').read()
|
||||||
|
|
||||||
hash = sha1(file).hexdigest()
|
hash = sha1(file).hexdigest()
|
||||||
lines[index] = '%s|%s\n' % (line, hash)
|
lines[index] = '%s|%s\n' % (line, hash)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue