Skip to content

Commit

Permalink
whyred: Handle moved blobs in update-sha1sums.py script
Browse files Browse the repository at this point in the history
Change-Id: Iccab8c8620c7ff680768aac2d9cbf5b5067af8d7
  • Loading branch information
luk1337 authored and SakilMondal committed Dec 20, 2020
1 parent 02fe57d commit 093d4fe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions update-sha1sums.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@
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)
Expand Down

0 comments on commit 093d4fe

Please sign in to comment.