sdm660-common: update-sha1sums: handle FileNotFound exception

Show missing file name and continue

Signed-off-by: pix106 <sbordenave@gmail.com>
This commit is contained in:
pix106 2021-08-13 08:20:08 +02:00
parent 541f980ac2
commit 2390d3600b

View file

@ -104,10 +104,14 @@ def update():
if filePath[0] == '-':
filePath = filePath[1:]
with open(os.path.join(vendorPath, filePath), 'rb') as f:
hash = sha1(f.read()).hexdigest()
try:
with open(os.path.join(vendorPath, filePath), 'rb') as f:
hash = sha1(f.read()).hexdigest()
lines[index] = '%s|%s' % (line, hash)
except FileNotFoundError:
print("File not found: %s" % filePath)
lines[index] = '%s|%s' % (line, hash)
lines.append('')