summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py40
1 files changed, 19 insertions, 21 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 9b5ba5a395..f629c01cdb 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -271,30 +271,28 @@ def verify_checksum(u, ud, d):
271 matched 271 matched
272 """ 272 """
273 273
274 if not ud.type in ["http", "https", "ftp", "ftps"]:
275 return
276
277 md5data = bb.utils.md5_file(ud.localpath) 274 md5data = bb.utils.md5_file(ud.localpath)
278 sha256data = bb.utils.sha256_file(ud.localpath) 275 sha256data = bb.utils.sha256_file(ud.localpath)
279 276
280 # If strict checking enabled and neither sum defined, raise error 277 if ud.type in ["http", "https", "ftp", "ftps"]:
281 strict = d.getVar("BB_STRICT_CHECKSUM", True) or None 278 # If strict checking enabled and neither sum defined, raise error
282 if (strict and ud.md5_expected == None and ud.sha256_expected == None): 279 strict = d.getVar("BB_STRICT_CHECKSUM", True) or None
283 raise FetchError('No checksum specified for %s, please add at least one to the recipe:\n' 280 if (strict and ud.md5_expected == None and ud.sha256_expected == None):
284 'SRC_URI[%s] = "%s"\nSRC_URI[%s] = "%s"' % 281 raise FetchError('No checksum specified for %s, please add at least one to the recipe:\n'
285 (ud.localpath, ud.md5_name, md5data, 282 'SRC_URI[%s] = "%s"\nSRC_URI[%s] = "%s"' %
286 ud.sha256_name, sha256data), u) 283 (ud.localpath, ud.md5_name, md5data,
287 284 ud.sha256_name, sha256data), u)
288 # Log missing sums so user can more easily add them 285
289 if ud.md5_expected == None: 286 # Log missing sums so user can more easily add them
290 logger.warn('Missing md5 SRC_URI checksum for %s, consider adding to the recipe:\n' 287 if ud.md5_expected == None:
291 'SRC_URI[%s] = "%s"', 288 logger.warn('Missing md5 SRC_URI checksum for %s, consider adding to the recipe:\n'
292 ud.localpath, ud.md5_name, md5data) 289 'SRC_URI[%s] = "%s"',
293 290 ud.localpath, ud.md5_name, md5data)
294 if ud.sha256_expected == None: 291
295 logger.warn('Missing sha256 SRC_URI checksum for %s, consider adding to the recipe:\n' 292 if ud.sha256_expected == None:
296 'SRC_URI[%s] = "%s"', 293 logger.warn('Missing sha256 SRC_URI checksum for %s, consider adding to the recipe:\n'
297 ud.localpath, ud.sha256_name, sha256data) 294 'SRC_URI[%s] = "%s"',
295 ud.localpath, ud.sha256_name, sha256data)
298 296
299 md5mismatch = False 297 md5mismatch = False
300 sha256mismatch = False 298 sha256mismatch = False