mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 09:49:33 +02: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
|
return
|
||||||
|
|
||||||
def hash_file(file_name):
|
def hash_file(file_name):
|
||||||
try:
|
from bb.utils import sha1_file
|
||||||
with open(file_name, 'rb') as f:
|
return sha1_file(file_name)
|
||||||
data_string = f.read()
|
|
||||||
sha1 = hash_string(data_string)
|
|
||||||
return sha1
|
|
||||||
except:
|
|
||||||
return None
|
|
||||||
|
|
||||||
def hash_string(data):
|
def hash_string(data):
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|||||||
Reference in New Issue
Block a user