summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/spdx.bbclass9
1 files changed, 2 insertions, 7 deletions
diff --git a/meta/classes/spdx.bbclass b/meta/classes/spdx.bbclass
index 9e374d70a6..a3e22afc33 100644
--- a/meta/classes/spdx.bbclass
+++ b/meta/classes/spdx.bbclass
@@ -202,13 +202,8 @@ def list_files(dir):
202 return 202 return
203 203
204def hash_file(file_name): 204def hash_file(file_name):
205 try: 205 from bb.utils import sha1_file
206 with open(file_name, 'rb') as f: 206 return sha1_file(file_name)
207 data_string = f.read()
208 sha1 = hash_string(data_string)
209 return sha1
210 except:
211 return None
212 207
213def hash_string(data): 208def hash_string(data):
214 import hashlib 209 import hashlib