summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2012-07-31 23:33:41 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-02 16:05:06 (GMT)
commit5d952ba4a00f14f005706e3c70a98f5f8cf6ab0f (patch)
tree287830c0d914879b657c14f6c390864972f9a6ed /bitbake/lib
parent420891731fd87fc04e973687cfe674765d0f0299 (diff)
downloadpoky-5d952ba4a00f14f005706e3c70a98f5f8cf6ab0f.tar.gz
bitbake: fetch2: print checksums when they are different then expected
* in form which can be copied into a recipe without modification * like oe-classic did since: http://git.openembedded.org/openembedded/commit/?id=68abc465559a68e9201c9525be3c4acc6297eaed * it shows them in right form when they are missing completely, but in more verbose form when different * it needs to print that only when checksums were requested, e.g. fetching from sstate mirror sets both md5mismatch and sha256mismatch, but your checksums shouldn't be shown (Bitbake rev: 9eb34fc866775fd8310759a0111f232a9dc98981) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index d911307..12ebce2 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -345,11 +345,17 @@ def verify_checksum(u, ud, d):
345 # We want to alert the user if a checksum is defined in the recipe but 345 # We want to alert the user if a checksum is defined in the recipe but
346 # it does not match. 346 # it does not match.
347 msg = "" 347 msg = ""
348 mismatch = False
348 if md5mismatch and ud.md5_expected: 349 if md5mismatch and ud.md5_expected:
349 msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected" % (ud.localpath, 'md5', md5data, ud.md5_expected) 350 msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected" % (ud.localpath, 'md5', md5data, ud.md5_expected)
351 mismatch = True;
350 352
351 if sha256mismatch and ud.sha256_expected: 353 if sha256mismatch and ud.sha256_expected:
352 msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected" % (ud.localpath, 'sha256', sha256data, ud.sha256_expected) 354 msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected" % (ud.localpath, 'sha256', sha256data, ud.sha256_expected)
355 mismatch = True;
356
357 if mismatch:
358 msg = msg + '\nYour checksums:\nSRC_URI[%s] = "%s"\nSRC_URI[%s] = "%s"' % (ud.md5_name, md5data, ud.sha256_name, sha256data)
353 359
354 if len(msg): 360 if len(msg):
355 raise ChecksumError('Checksum mismatch!%s' % msg, u) 361 raise ChecksumError('Checksum mismatch!%s' % msg, u)