summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-07-19 11:56:11 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-21 08:41:12 +0100
commit002a99c6b99116be461802360124a9fd6fef6379 (patch)
tree2218e2e6689e47827f4d86e195f8d5071b3e92e9 /bitbake/lib
parentde4066ea5299cf99a382956cf673f13343a08c42 (diff)
downloadpoky-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__.py10
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
39import bb.persist_data, bb.utils 39import bb.persist_data, bb.utils
40import bb.checksum 40import bb.checksum
41import bb.process 41import bb.process
42import 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
146class 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
146class URI(object): 154class 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,