From 978f5a8f16bf5942aad73d761df2a00aeb36339d Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Mon, 16 Jul 2018 17:05:55 +0200 Subject: spdx.bbclass: Make use of bb.utils' sha1_file() The same functionality already exists within bitbake, so avoid duplicating. Signed-off-by: Olof Johansson Signed-off-by: Ross Burton --- meta/classes/spdx.bbclass | 9 ++------- 1 file 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): 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 -- cgit 1.2.3-korg