[oe-commits] [openembedded-core] 35/43: spdx.bbclass: Make use of bb.utils' sha1_file()

git at git.openembedded.org git at git.openembedded.org
Tue Jul 17 08:14:31 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 7b850dd45ca4060e6736932e84c77db8c1ca17c4
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