diff options
author | Olof Johansson <olof.johansson@axis.com> | 2018-07-16 17:05:55 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-18 10:18:42 +0100 |
commit | 83b3e1463a4e8c6ab16ecc559ef7e3f793c5ba86 (patch) | |
tree | da9a915a2acd79f34126764939ff4e97994fef8f /meta/classes/spdx.bbclass | |
parent | ae7d14ab44bfb6a96f461932025652f80c067c11 (diff) | |
download | poky-83b3e1463a4e8c6ab16ecc559ef7e3f793c5ba86.tar.gz |
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>
Diffstat (limited to 'meta/classes/spdx.bbclass')
-rw-r--r-- | meta/classes/spdx.bbclass | 9 |
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 | ||
204 | def hash_file(file_name): | 204 | def 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 | ||
213 | def hash_string(data): | 208 | def hash_string(data): |
214 | import hashlib | 209 | import hashlib |