[oe-commits] [bitbake] 13/18: fetch2: fire an event when there are missing checksums

git at git.openembedded.org git at git.openembedded.org
Wed Jul 19 09:43:27 UTC 2017


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

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

commit 20685e10969b94905221ee022946c126b12818cf
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Tue Jun 27 15:54:37 2017 +0100

    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.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/fetch2/__init__.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 2e615b2..74ba37f 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -39,6 +39,7 @@ import errno
 import bb.persist_data, bb.utils
 import bb.checksum
 import bb.process
+import bb.event
 
 __version__ = "2"
 _checksum_cache = bb.checksum.FileChecksumCache()
@@ -142,6 +143,13 @@ class NonLocalMethod(Exception):
     def __init__(self):
         Exception.__init__(self)
 
+class MissingChecksumEvent(bb.event.Event):
+    def __init__(self, url, md5sum, sha256sum):
+        self.url = url
+        self.checksums = {'md5sum': md5sum,
+                          'sha256sum': sha256sum}
+        bb.event.Event.__init__(self)
+
 
 class URI(object):
     """
@@ -584,6 +592,8 @@ def verify_checksum(ud, d, precomputed={}):
                               ud.sha256_name, sha256data))
             raise NoChecksumError('Missing SRC_URI checksum', ud.url)
 
+        bb.event.fire(MissingChecksumEvent(ud.url, md5data, sha256data), d)
+
         if strict == "ignore":
             return {
                 _MD5_KEY: md5data,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list