mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 05:09:24 +00:00
spdx.bbclass: Make use of bb.utils' sha1_file()
The same functionality already exists within bitbake, so avoid duplicating. (From OE-Core rev: 978f5a8f16bf5942aad73d761df2a00aeb36339d) Signed-off-by: Olof Johansson <olofjn@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
ae7d14ab44
commit
83b3e1463a
@@ -202,13 +202,8 @@ def list_files(dir):
|
||||
return
|
||||
|
||||
def hash_file(file_name):
|
||||
try:
|
||||
with open(file_name, 'rb') as f:
|
||||
data_string = f.read()
|
||||
sha1 = hash_string(data_string)
|
||||
return sha1
|
||||
except:
|
||||
return None
|
||||
from bb.utils import sha1_file
|
||||
return sha1_file(file_name)
|
||||
|
||||
def hash_string(data):
|
||||
import hashlib
|
||||
|
||||
Reference in New Issue
Block a user