Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH] fetch2: print checksums when they are different then expected
@ 2012-07-31 11:01 Martin Jansa
  2012-07-31 23:33 ` [PATCHv2] " Martin Jansa
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Jansa @ 2012-07-31 11:01 UTC (permalink / raw)
  To: bitbake-devel

* 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

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 lib/bb/fetch2/__init__.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index fa963be..46e9b6e 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -348,6 +348,9 @@ def verify_checksum(u, ud, d):
     if sha256mismatch and ud.sha256_expected:
         msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected" % (ud.localpath, 'sha256', sha256data, ud.sha256_expected)
 
+    if md5mismatch or sha256mismatch:
+        msg = msg + '\nYour checksums:\nSRC_URI[%s] = "%s"\nSRC_URI[%s] = "%s"' % (ud.md5_name, md5data, ud.sha256_name, sha256data)
+
     if len(msg):
         raise ChecksumError('Checksum mismatch!%s' % msg, u)
 
-- 
1.7.8.6




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCHv2] fetch2: print checksums when they are different then expected
  2012-07-31 11:01 [PATCH] fetch2: print checksums when they are different then expected Martin Jansa
@ 2012-07-31 23:33 ` Martin Jansa
  2012-08-02 16:06   ` Richard Purdie
  2012-08-02 16:06   ` Richard Purdie
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Jansa @ 2012-07-31 23:33 UTC (permalink / raw)
  To: bitbake-devel

* 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

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 lib/bb/fetch2/__init__.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index fa963be..31602fe 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -342,11 +342,17 @@ def verify_checksum(u, ud, d):
     # We want to alert the user if a checksum is defined in the recipe but
     # it does not match.
     msg = ""
+    mismatch = False
     if md5mismatch and ud.md5_expected:
         msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected" % (ud.localpath, 'md5', md5data, ud.md5_expected)
+        mismatch = True;
 
     if sha256mismatch and ud.sha256_expected:
         msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected" % (ud.localpath, 'sha256', sha256data, ud.sha256_expected)
+        mismatch = True;
+
+    if mismatch:
+        msg = msg + '\nYour checksums:\nSRC_URI[%s] = "%s"\nSRC_URI[%s] = "%s"' % (ud.md5_name, md5data, ud.sha256_name, sha256data)
 
     if len(msg):
         raise ChecksumError('Checksum mismatch!%s' % msg, u)
-- 
1.7.8.6




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCHv2] fetch2: print checksums when they are different then expected
  2012-07-31 23:33 ` [PATCHv2] " Martin Jansa
@ 2012-08-02 16:06   ` Richard Purdie
  2012-08-02 16:06   ` Richard Purdie
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2012-08-02 16:06 UTC (permalink / raw)
  To: Martin Jansa; +Cc: bitbake-devel

On Wed, 2012-08-01 at 01:33 +0200, Martin Jansa wrote:
> * 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
> 
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  lib/bb/fetch2/__init__.py |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCHv2] fetch2: print checksums when they are different then expected
  2012-07-31 23:33 ` [PATCHv2] " Martin Jansa
  2012-08-02 16:06   ` Richard Purdie
@ 2012-08-02 16:06   ` Richard Purdie
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2012-08-02 16:06 UTC (permalink / raw)
  To: Martin Jansa; +Cc: bitbake-devel

On Wed, 2012-08-01 at 01:33 +0200, Martin Jansa wrote:
> * 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
> 
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  lib/bb/fetch2/__init__.py |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-02 16:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-31 11:01 [PATCH] fetch2: print checksums when they are different then expected Martin Jansa
2012-07-31 23:33 ` [PATCHv2] " Martin Jansa
2012-08-02 16:06   ` Richard Purdie
2012-08-02 16:06   ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox