summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-12-20 14:48:44 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-22 14:29:12 +0000
commit1edb126af3d614a1d9fb9561b1f1f858ec452563 (patch)
tree50409eaadc6cb5eaf927bbd65ae311c1aea8f4f7
parent85ac39431a549e0e6a94aa8cba6e8428a8a8758d (diff)
downloadast2050-yocto-poky-1edb126af3d614a1d9fb9561b1f1f858ec452563.zip
ast2050-yocto-poky-1edb126af3d614a1d9fb9561b1f1f858ec452563.tar.gz
bitbake: fetch2: fail checksum validation if SRC_URI checksums set to ""
We were checking SRC_URI md5sum/sha256sum values against None here, so if they were set to "" then no error was produced. Since the value is still effectively unset in this case, this is not the right behaviour; just check if the value doesn't evaluate to False instead. (Bitbake rev: 040943a718795c64dc4e604abfcf08b26b7d00e6) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 199cdca..6c6915c 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -526,19 +526,19 @@ def verify_checksum(ud, d):
if ud.method.recommends_checksum(ud):
# If strict checking enabled and neither sum defined, raise error
strict = d.getVar("BB_STRICT_CHECKSUM", True) or None
- if (strict and ud.md5_expected == None and ud.sha256_expected == None):
+ if strict and not (ud.md5_expected or ud.sha256_expected):
raise NoChecksumError('No checksum specified for %s, please add at least one to the recipe:\n'
'SRC_URI[%s] = "%s"\nSRC_URI[%s] = "%s"' %
(ud.localpath, ud.md5_name, md5data,
ud.sha256_name, sha256data), ud.url)
# Log missing sums so user can more easily add them
- if ud.md5_expected == None:
+ if not ud.md5_expected:
logger.warn('Missing md5 SRC_URI checksum for %s, consider adding to the recipe:\n'
'SRC_URI[%s] = "%s"',
ud.localpath, ud.md5_name, md5data)
- if ud.sha256_expected == None:
+ if not ud.sha256_expected:
logger.warn('Missing sha256 SRC_URI checksum for %s, consider adding to the recipe:\n'
'SRC_URI[%s] = "%s"',
ud.localpath, ud.sha256_name, sha256data)
OpenPOWER on IntegriCloud