Patchwork [2/2] classes/insane: restore printing LIC_FILES_CHKSUM checksum if not specified

login
register
mail settings
Submitter Paul Eggleton
Date Dec. 20, 2013, 2:55 p.m.
Message ID <910ec21046171291eadeb7c45560ec798483485c.1387551254.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/63641/
State New
Headers show

Comments

Paul Eggleton - Dec. 20, 2013, 2:55 p.m.
OE-Core rev ec8590aa81e201e28e500935d31cd7266114471f (by me)
unintentionally disabled printing the actual checksum value if no
checksum was specified, i.e.:

LIC_FILES_CHKSUM = "file://COPYING;md5="

Printing the actual checksum in this case is really useful when writing
a new recipe, so put this back in.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/insane.bbclass | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

Patch

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index e77e993..55ed91f 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -604,9 +604,6 @@  def package_qa_check_license(workdir, d):
             raise bb.build.FuncFailed( pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile)
 
         recipemd5 = parm.get('md5', '')
-        if not recipemd5:
-            bb.error(pn + ": md5 checksum is not specified for ", url)
-            return False
         beginline, endline = 0, 0
         if 'beginline' in parm:
             beginline = int(parm['beginline'])
@@ -638,18 +635,22 @@  def package_qa_check_license(workdir, d):
         if recipemd5 == md5chksum:
             bb.note (pn + ": md5 checksum matched for ", url)
         else:
-            bb.error (pn + ": md5 data is not matching for ", url)
-            bb.error (pn + ": The new md5 checksum is ", md5chksum)
-            if beginline:
-                if endline:
-                    srcfiledesc = "%s (lines %d through to %d)" % (srclicfile, beginline, endline)
+            if recipemd5:
+                bb.error(pn + ": md5 data is not matching for ", url)
+                bb.error(pn + ": The new md5 checksum is ", md5chksum)
+                if beginline:
+                    if endline:
+                        srcfiledesc = "%s (lines %d through to %d)" % (srclicfile, beginline, endline)
+                    else:
+                        srcfiledesc = "%s (beginning on line %d)" % (srclicfile, beginline)
+                elif endline:
+                    srcfiledesc = "%s (ending on line %d)" % (srclicfile, endline)
                 else:
-                    srcfiledesc = "%s (beginning on line %d)" % (srclicfile, beginline)
-            elif endline:
-                srcfiledesc = "%s (ending on line %d)" % (srclicfile, endline)
+                    srcfiledesc = srclicfile
+                bb.error(pn + ": Check if the license information has changed in %s to verify that the LICENSE value \"%s\" remains valid" % (srcfiledesc, lic))
             else:
-                srcfiledesc = srclicfile
-            bb.error(pn + ": Check if the license information has changed in %s to verify that the LICENSE value \"%s\" remains valid" % (srcfiledesc, lic))
+                bb.error(pn + ": md5 checksum is not specified for ", url)
+                bb.error(pn + ": The md5 checksum is ", md5chksum)
             sane = False
 
     return sane