[oe-commits] [openembedded-core] 32/41: spdx.bbclass: Make use of bb.utils' sha1_file()
git at git.openembedded.org
git at git.openembedded.org
Wed Jul 18 09:20:34 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master
in repository openembedded-core.
commit 978f5a8f16bf5942aad73d761df2a00aeb36339d
Author: Olof Johansson <olof.johansson at axis.com>
AuthorDate: Mon Jul 16 17:05:55 2018 +0200
spdx.bbclass: Make use of bb.utils' sha1_file()
The same functionality already exists within bitbake, so avoid
duplicating.
Signed-off-by: Olof Johansson <olofjn at axis.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
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 9e374d7..a3e22af 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
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list