Skip to contentSkip to conversation

Misc cleanups / validation improvements

PATCH New Paul Eggleton 1 participant 12 messages Nov 13, 2013

lore
Share & tools
lore
#0 lore raw

cover Misc cleanups / validation improvements

Tidy up a bunch of minor things I had on my todo list or that I noticed recently. Note the two class removals at the end.

The following changes since commit 616354f13732d13c17434d5b60b166f691c25761:

binutils: Add gnu-config-native to DEPENDS (2013-11-12 16:00:20 +0000)

are available in the git repository at:

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

Paul Eggleton (11):
scripts/create-recipe: fix handling of --help classes/insane: improve LIC_FILES_CHKSUM messages classes/sanity: validate SDKMACHINE value bitbake.conf: remove BOOTSTRAP_EXTRA_* variable defaults bitbake.conf: remove CPU_FEATURES defaults
gtk-immodules-cache: fix error message to use correct names classes/license: use "1" to set boolean variables classes/license: fix comments
systemd: fix comments
classes/pkg_distribute: remove classes/pkg_metainfo: remove

 meta/classes/gtk-immodules-cache.bbclass |  2 +-
 meta/classes/insane.bbclass              | 16 +++++++++++++---
 meta/classes/license.bbclass             | 10 +++++-----
 meta/classes/pkg_distribute.bbclass      | 29 -----------------------------
 meta/classes/pkg_metainfo.bbclass        | 22 ----------------------
 meta/classes/sanity.bbclass              |  5 +++++
 meta/classes/systemd.bbclass             |  4 ++--
 meta/conf/bitbake.conf                   | 10 ----------
 meta/recipes-core/systemd/systemd_208.bb |  4 ++--
 scripts/create-recipe                    |  2 +-
 10 files changed, 29 insertions(+), 75 deletions(-)
 delete mode 100644 meta/classes/pkg_distribute.bbclass
 delete mode 100644 meta/classes/pkg_metainfo.bbclass
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/11 scripts/create-recipe: fix handling of --help

If --help is specified as the first argument, show the standard help text instead of trying to process it as a URL.

---
 scripts/create-recipe | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/create-recipe +1 -1
index 5613e92..b192990 100755
@@ -1794,7 +1794,7 @@ sub calculate_sums
 # Main program 
 #
 
-if ( @ARGV < 1 ) {
+if ( @ARGV < 1 || $ARGV[0] eq "--help" ) {
     print "Usage: $0 [-r] <url-of-source-tarballs>\n";
     exit(1);
 }
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH 2/11 classes/insane: improve LIC_FILES_CHKSUM messages

In reply to Paul Eggleton

* If the md5 parameter is specified with no value, report that the checksum is not specified instead of reporting that it has changed
* If the md5 checksum has changed, point directly to the license file in a way that is easy to copy and paste and give the line numbers in an easy to read form, as well as asking the user to verify that the new contents matches the current LICENSE value.

---
 meta/classes/insane.bbclass | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
meta/classes/insane.bbclass +13 -3
index 3558dee..f9f8def 100644
@@ -602,7 +602,8 @@ def package_qa_check_license(workdir, d):
         if not os.path.isfile(srclicfile):
             raise bb.build.FuncFailed( pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile)
 
-        if 'md5' not in parm:
+        recipemd5 = parm.get('md5', '')
+        if not recipemd5:
             bb.error(pn + ": md5 checksum is not specified for ", url)
             return False
         beginline, endline = 0, 0
@@ -633,12 +634,21 @@ def package_qa_check_license(workdir, d):
             md5chksum = bb.utils.md5_file(tmplicfile)
             os.unlink(tmplicfile)
 
-        if parm['md5'] == md5chksum:
+        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)
-            bb.error (pn + ": Check if the license information has changed in")
+            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 = srclicfile
+            bb.error(pn + ": Check if the license information has changed in %s to verify that the LICENSE value \"%s\" remains valid" % (srcfiledesc, lic))
             sane = False
 
     return sane
Signature · 1 line
1.8.1.2
#3 lore raw

PATCH 3/11 classes/sanity: validate SDKMACHINE value

In reply to Paul Eggleton

If SDKMACHINE is set then check that a configuration file matching it actually exists, otherwise the user won't know that they've set it incorrectly.

---
 meta/classes/sanity.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
meta/classes/sanity.bbclass +5 -0
index 83378b0..6807a23 100644
@@ -625,6 +625,11 @@ def check_sanity_everybuild(status, d):
     if machinevalid:
         status.addresult(check_toolchain(d))
 
+    # Check that the SDKMACHINE is valid, if it is set
+    if d.getVar('SDKMACHINE', True):
+        if not check_conf_exists("conf/machine-sdk/${SDKMACHINE}.conf", d):
+            status.addresult('Specified SDKMACHINE value is not valid\n')
+
     check_supported_distro(d)
 
     # Check if DISPLAY is set if TEST_IMAGE is set
Signature · 1 line
1.8.1.2
#4 lore raw

PATCH 4/11 bitbake.conf: remove BOOTSTRAP_EXTRA_* variable defaults

In reply to Paul Eggleton

These were for task-bootstrap in OE-Classic and have never been used in OE-Core.

---
 meta/conf/bitbake.conf | 7 -------
 1 file changed, 7 deletions(-)
meta/conf/bitbake.conf +0 -7
index ea313ad..b01c69f 100644
@@ -552,13 +552,6 @@ SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION"
 BUILD_OPTIMIZATION = "-O2 -pipe"
 
 ##################################################################
-# Bootstrap stuff.
-##################################################################
-
-BOOTSTRAP_EXTRA_RDEPENDS = ""
-BOOTSTRAP_EXTRA_RRECOMMENDS = ""
-
-##################################################################
 # Download locations and utilities.
 ##################################################################
 
Signature · 1 line
1.8.1.2
#5 lore raw

PATCH 5/11 bitbake.conf: remove CPU_FEATURES defaults

In reply to Paul Eggleton

This variable has been unused since the tune file overhaul two years ago.

---
 meta/conf/bitbake.conf | 3 ---
 1 file changed, 3 deletions(-)
meta/conf/bitbake.conf +0 -3
index b01c69f..d7d703d 100644
@@ -675,9 +675,6 @@ MACHINEOVERRIDES[vardepsexclude] = "MACHINE"
 
 FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}"
 
-CPU_FEATURES ?= ""
-CPU_FEATURES_arm ?= "vfp"
-
 ##################################################################
 # Include the rest of the config files.
 ##################################################################
Signature · 1 line
1.8.1.2
#6 lore raw

PATCH 6/11 gtk-immodules-cache: fix error message to use correct names

In reply to Paul Eggleton

It's gtk-immodules-cache and GTKIMMODULES_PACKAGES.

---
 meta/classes/gtk-immodules-cache.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/gtk-immodules-cache.bbclass +1 -1
index e11ed22..5b45149 100644
@@ -78,6 +78,6 @@ python __anonymous() {
         gtkimmodules_check = d.getVar('GTKIMMODULES_PACKAGES')
         if not gtkimmodules_check:
             bb_filename = d.getVar('FILE')
-            raise bb.build.FuncFailed("ERROR: %s inherits gtk-immodule-cache but doesn't set GTKIMMODULES_PACKAGE" % bb_filename)
+            raise bb.build.FuncFailed("ERROR: %s inherits gtk-immodules-cache but doesn't set GTKIMMODULES_PACKAGES" % bb_filename)
 }
 
Signature · 1 line
1.8.1.2
#7 lore raw

PATCH 7/11 classes/license: use "1" to set boolean variables

In reply to Paul Eggleton

The expected usage of COPY_LIC_MANIFEST and COPY_LIC_DIRS appears to be to set them to "1" to enable; however the test here is just testing whether they have a value at all, so setting them to "0" would also enable them which is somewhat disingenuous. Actually check if they are set to "1" instead in order to fix this.

---
 meta/classes/license.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/license.bbclass +2 -2
index 1c1b679..419105b 100644
@@ -62,10 +62,10 @@ license_create_manifest() {
 	# - Just copy the manifest
 	# - Copy the manifest and the license directories
 	# With both options set we see a .5 M increase in core-image-minimal
-	if [ -n "${COPY_LIC_MANIFEST}" ]; then
+	if [ "${COPY_LIC_MANIFEST}" = "1" ]; then
 		mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/
 		cp ${LICENSE_MANIFEST} ${IMAGE_ROOTFS}/usr/share/common-licenses/license.manifest
-		if [ -n "${COPY_LIC_DIRS}" ]; then
+		if [ "${COPY_LIC_DIRS}" = "1" ]; then
 			for pkg in ${INSTALLED_PKGS}; do
 				mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}
 				for lic in `ls ${LICENSE_DIRECTORY}/${pkg}`; do
Signature · 1 line
1.8.1.2
#8 lore raw

PATCH 8/11 classes/license: fix comments

In reply to Paul Eggleton

It's LICENSE_FLAGS, LICENSE_FLAG is invalid.

---
 meta/classes/license.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/classes/license.bbclass +3 -3
index 419105b..6d7ee94 100644
@@ -290,11 +290,11 @@ def incompatible_license(d, dont_want_licenses, package=None):
 
 def check_license_flags(d):
     """
-    This function checks if a recipe has any LICENSE_FLAGs that
+    This function checks if a recipe has any LICENSE_FLAGS that
     aren't whitelisted.
 
-    If it does, it returns the first LICENSE_FLAG missing from the
-    whitelist, or all the LICENSE_FLAGs if there is no whitelist.
+    If it does, it returns the first LICENSE_FLAGS item missing from the
+    whitelist, or all of the LICENSE_FLAGS if there is no whitelist.
 
     If everything is is properly whitelisted, it returns None.
     """
Signature · 1 line
1.8.1.2
#9 lore raw

PATCH 9/11 systemd: fix comments

In reply to Paul Eggleton

It's DISTRO_FEATURES; DISTRO_FEATURE is invalid.

---
 meta/classes/systemd.bbclass             | 4 ++--
 meta/recipes-core/systemd/systemd_208.bb | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
meta/classes/systemd.bbclass +2 -2
index 3700b2e..7a8d35c 100644
@@ -9,8 +9,8 @@ SYSTEMD_PACKAGES_class-nativesdk ?= ""
 SYSTEMD_AUTO_ENABLE ??= "enable"
 
 # This class will be included in any recipe that supports systemd init scripts,
-# even if the systemd DISTRO_FEATURE isn't enabled.  As such don't make any
-# changes directly but check the DISTRO_FEATURES first.
+# even if systemd is not in DISTRO_FEATURES.  As such don't make any changes
+# directly but check the DISTRO_FEATURES first.
 python __anonymous() {
     features = d.getVar("DISTRO_FEATURES", True).split()
     # If the distro features have systemd but not sysvinit, inhibit update-rcd
meta/recipes-core/systemd/systemd_208.bb +2 -2
index ee716f4..8c70fe5 100644
@@ -323,8 +323,8 @@ pkg_prerm_udev-hwdb () {
 	rm -f ${sysconfdir}/udev/hwdb.bin
 }
 
-# As this recipe builds udev, respect the systemd DISTRO_FEATURE so we don't try
-# building udev and systemd in world builds.
+# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
+# that we don't build both udev and systemd in world builds.
 python () {
     if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
         raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
Signature · 1 line
1.8.1.2
#10 lore raw

PATCH 10/11 classes/pkg_distribute: remove

In reply to Paul Eggleton

This appears to be a very old way of archiving recipes and associated files. We have better ways of doing this now, and nobody appears to be using this class - even OE-Classic had no current references to it.

---
 meta/classes/pkg_distribute.bbclass | 29 -----------------------------
 1 file changed, 29 deletions(-)
 delete mode 100644 meta/classes/pkg_distribute.bbclass
meta/classes/pkg_distribute.bbclass deleted +0 -29
deleted file mode 100644
index 9f249a0..0000000
@@ -1,29 +0,0 @@
-PKG_DISTRIBUTECOMMAND[func] = "1"
-python do_distribute_packages () {
-	cmd = d.getVar('PKG_DISTRIBUTECOMMAND', True)
-	if not cmd:
-		raise bb.build.FuncFailed("Unable to distribute packages, PKG_DISTRIBUTECOMMAND not defined")
-	bb.build.exec_func('PKG_DISTRIBUTECOMMAND', d)
-}
-
-addtask distribute_packages before do_build after do_fetch
-
-PKG_DIST_LOCAL ?= "symlink"
-PKG_DISTRIBUTEDIR ?= "${DEPLOY_DIR}/packages"
-
-PKG_DISTRIBUTECOMMAND () {
-	p=`dirname ${FILE}`
-	d=`basename $p`
-	mkdir -p ${PKG_DISTRIBUTEDIR}
-	case "${PKG_DIST_LOCAL}" in
-		copy)
-			# use this weird tar command to copy because we want to 
-			# exclude the BitKeeper directories
-			test -e ${PKG_DISTRIBUTEDIR}/${d} || mkdir ${PKG_DISTRIBUTEDIR}/${d};
-			(cd ${p}; tar -c --exclude SCCS -f - . ) | tar -C ${PKG_DISTRIBUTEDIR}/${d} -xpf -
-			;;
-		symlink)
-			ln -sf $p ${PKG_DISTRIBUTEDIR}/
-			;;
-	esac
-}
Signature · 1 line
1.8.1.2
#11 lore raw

PATCH 11/11 classes/pkg_metainfo: remove

In reply to Paul Eggleton

This is very old, and we now have pkgdata which is much more complete. Nobody appears to be using this class, and even OE-Classic had no current references to it.

---
 meta/classes/pkg_metainfo.bbclass | 22 ----------------------
 1 file changed, 22 deletions(-)
 delete mode 100644 meta/classes/pkg_metainfo.bbclass
meta/classes/pkg_metainfo.bbclass deleted +0 -22
deleted file mode 100644
index 80f6244..0000000
@@ -1,22 +0,0 @@
-python do_pkg_write_metainfo () {
-    deploydir = d.getVar('DEPLOY_DIR', True)
-    if not deploydir:
-        bb.error("DEPLOY_DIR not defined, unable to write package info")
-        return
-
-    try:
-        infofile = file(os.path.join(deploydir, 'package-metainfo'), 'a')
-    except OSError:
-        raise bb.build.FuncFailed("unable to open package-info file for writing.")
-
-    name = d.getVar('PN', True)
-    version = d.getVar('PV', True)
-    desc = d.getVar('DESCRIPTION', True)
-    page = d.getVar('HOMEPAGE', True)
-    lic = d.getVar('LICENSE', True)
-
-    infofile.write("|| "+ name +" || "+ version + " || "+ desc +" || "+ page +" || "+ lic + " ||\n" ) 
-    infofile.close()
-}
-
-addtask pkg_write_metainfo after do_package before do_build
Signature · 1 line
1.8.1.2