diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-07-19 11:56:11 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-21 08:41:12 +0100 |
commit | 002a99c6b99116be461802360124a9fd6fef6379 (patch) | |
tree | 2218e2e6689e47827f4d86e195f8d5071b3e92e9 /bitbake/lib | |
parent | de4066ea5299cf99a382956cf673f13343a08c42 (diff) | |
download | poky-002a99c6b99116be461802360124a9fd6fef6379.tar.gz |
bitbake: fetch2: fire an event when there are missing checksums
If BB_STRICT_CHECKSUMS is set to anything other than "1" i.e. we're not
going to raise an error, then fire an event so that scripts can listen
for it and get the checksums.
(Bitbake rev: 8b2ccb4b865f2df118ef668847df682a83f9c500)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 2e615b2d6a..74ba37f458 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
@@ -39,6 +39,7 @@ import errno | |||
39 | import bb.persist_data, bb.utils | 39 | import bb.persist_data, bb.utils |
40 | import bb.checksum | 40 | import bb.checksum |
41 | import bb.process | 41 | import bb.process |
42 | import bb.event | ||
42 | 43 | ||
43 | __version__ = "2" | 44 | __version__ = "2" |
44 | _checksum_cache = bb.checksum.FileChecksumCache() | 45 | _checksum_cache = bb.checksum.FileChecksumCache() |
@@ -142,6 +143,13 @@ class NonLocalMethod(Exception): | |||
142 | def __init__(self): | 143 | def __init__(self): |
143 | Exception.__init__(self) | 144 | Exception.__init__(self) |
144 | 145 | ||
146 | class MissingChecksumEvent(bb.event.Event): | ||
147 | def __init__(self, url, md5sum, sha256sum): | ||
148 | self.url = url | ||
149 | self.checksums = {'md5sum': md5sum, | ||
150 | 'sha256sum': sha256sum} | ||
151 | bb.event.Event.__init__(self) | ||
152 | |||
145 | 153 | ||
146 | class URI(object): | 154 | class URI(object): |
147 | """ | 155 | """ |
@@ -584,6 +592,8 @@ def verify_checksum(ud, d, precomputed={}): | |||
584 | ud.sha256_name, sha256data)) | 592 | ud.sha256_name, sha256data)) |
585 | raise NoChecksumError('Missing SRC_URI checksum', ud.url) | 593 | raise NoChecksumError('Missing SRC_URI checksum', ud.url) |
586 | 594 | ||
595 | bb.event.fire(MissingChecksumEvent(ud.url, md5data, sha256data), d) | ||
596 | |||
587 | if strict == "ignore": | 597 | if strict == "ignore": |
588 | return { | 598 | return { |
589 | _MD5_KEY: md5data, | 599 | _MD5_KEY: md5data, |