Skip to contentSkip to conversation

More reasonable LIC_FILES_CHKSUM enforcement

PATCH Superseded Paul Eggleton 1 participant 3 messages May 8, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover More reasonable LIC_FILES_CHKSUM enforcement

Requiring every image recipe to set LIC_FILES_CHKSUM is a bit extreme. Here's a better way to handle the check as well as a patch dropping LIC_FILES_CHKSUM where it isn't needed afterwards.

The following changes since commit ece101be5158beee709cdfbb85ecdbdc8d9fb864:

test-empty-image: Fix LIC_FILES_CHKSUM typo (2016-05-06 10:47:59 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib paule/lic-files-chksum
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/lic-files-chksum

Paul Eggleton (2):
classes/insane: do not force LIC_FILES_CHKSUM unless SRC_URI is set Drop unneeded LIC_FILES_CHKSUM values

 meta-selftest/recipes-test/images/test-empty-image.bb  | 1 -
 meta-selftest/recipes-test/images/wic-image-minimal.bb | 2 --
 meta/classes/core-image.bbclass                        | 5 +----
 meta/classes/insane.bbclass                            | 6 +++---
 meta/classes/packagegroup.bbclass                      | 3 ---
 meta/recipes-core/meta/meta-world-pkgdata.bb           | 1 -
 meta/recipes-graphics/images/core-image-directfb.bb    | 4 ----
 7 files changed, 4 insertions(+), 18 deletions(-)
Signature · 1 line
2.5.5
#1 lore raw

PATCH 1/2 classes/insane: do not force LIC_FILES_CHKSUM unless SRC_URI is set

Recipes such as images and packagegroups don't actually fetch or build any source, so there's really no point having LIC_FILES_CHKSUM set. Forcing users to set it (as we have done for images inheriting image.bbclass) just makes things more difficult for the user for no discernable benefit. The easiest way to adjust this check is simply to skip it if SRC_URI is not set since this is a pretty good indicator that no source is being pulled in.

---
 meta/classes/insane.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/classes/insane.bbclass +3 -3
index 097dc3a..0b151c2 100644
@@ -681,15 +681,15 @@ python populate_lic_qa_checksum() {
     import tempfile
     sane = True
 
-    lic_files = d.getVar('LIC_FILES_CHKSUM', True)
+    lic_files = d.getVar('LIC_FILES_CHKSUM', True) or ''
     lic = d.getVar('LICENSE', True)
     pn = d.getVar('PN', True)
 
     if lic == "CLOSED":
         return
 
-    if not lic_files:
-        package_qa_handle_error("license-checksum", pn + ": Recipe file does not have license file information (LIC_FILES_CHKSUM)", d)
+    if not lic_files and d.getVar('SRC_URI', True):
+        package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d)
         return
 
     srcdir = d.getVar('S', True)
Signature · 1 line
2.5.5
#2 lore raw

PATCH 2/2 Drop unneeded LIC_FILES_CHKSUM values

In reply to Paul Eggleton

With the changes to insane.bbclass we don't need LIC_FILES_CHKSUM to be set for recipes that don't actually pull in any source.

---
 meta-selftest/recipes-test/images/test-empty-image.bb  | 1 -
 meta-selftest/recipes-test/images/wic-image-minimal.bb | 2 --
 meta/classes/core-image.bbclass                        | 5 +----
 meta/classes/packagegroup.bbclass                      | 3 ---
 meta/recipes-core/meta/meta-world-pkgdata.bb           | 1 -
 meta/recipes-graphics/images/core-image-directfb.bb    | 4 ----
 6 files changed, 1 insertion(+), 15 deletions(-)
meta-selftest/recipes-test/images/test-empty-image.bb +0 -1
index 7847f83..88d8d61 100644
@@ -2,6 +2,5 @@ SUMMARY = "An empty image."
 IMAGE_INSTALL = ""
 IMAGE_LINGUAS = ""
 PACKAGE_INSTALL = ""
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 inherit image
meta-selftest/recipes-test/images/wic-image-minimal.bb +0 -2
index 754689f..a294ba7 100644
@@ -9,8 +9,6 @@ RM_OLD_IMAGE = "1"
 
 DEPENDS = "syslinux syslinux-native parted-native dosfstools-native mtools-native gptfdisk-native"
 
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-
 # core-image-minimal is referenced in .wks, so we need its rootfs
 # to be ready before our rootfs
 do_rootfs[depends] += "core-image-minimal:do_image core-image-minimal:do_rootfs_wicenv"
meta/classes/core-image.bbclass +1 -4
index 705cad8..da51409 100644
@@ -1,10 +1,7 @@
 # Common code for generating core reference images
 #
 # Copyright (C) 2007-2011 Linux Foundation
-
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-
+#
 # IMAGE_FEATURES control content of the core reference images
 # 
 # By default we install packagegroup-core-boot and packagegroup-base-extended packages;
meta/classes/packagegroup.bbclass +0 -3
index 3674894..3928c8a 100644
@@ -15,9 +15,6 @@ PACKAGE_ARCH ?= "all"
 PACKAGE_ARCH_EXPANDED := "${PACKAGE_ARCH}"
 
 LICENSE ?= "MIT"
-LIC_FILES_CHKSUM ?= "${@oe.utils.ifelse(d.getVar('LICENSE', True) == 'MIT', \
-                     'file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420', \
-                    '')}"
 
 inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED', True) == 'all', 'allarch', '')}
 
meta/recipes-core/meta/meta-world-pkgdata.bb +0 -1
index b3989cd..81c8647 100644
@@ -1,6 +1,5 @@
 SUMMARY = "Pulls in pkgdata for world"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM ?= "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
meta/recipes-graphics/images/core-image-directfb.bb +0 -4
index 5641195..c6ce658 100644
@@ -1,10 +1,6 @@
 SUMMARY = "An image that uses DirectFB instead of X11"
 LICENSE = "MIT"
 
-
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-
 inherit core-image distro_features_check
 
 REQUIRED_DISTRO_FEATURES = "directfb"
Signature · 1 line
2.5.5