[OE-core] [PATCH 1/1] insane.bbclass: make do_package_qa be a task

Kang Kai kai.kang at windriver.com
Mon Mar 11 03:31:17 UTC 2013


do_package_qa is added to variable PACKAGEFUNCS and run after
do_package. packaging tests should not ending up in package.bbclass.
Split do_package_qa as a new task after do_package.

[YOCTO #3190]

Signed-off-by: Kang Kai <kai.kang at windriver.com>
---
 meta/classes/insane.bbclass |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index bd6f120..d7787ac 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -17,9 +17,9 @@
 #   files under exec_prefix
 
 
-inherit package
+#inherit package
 PACKAGE_DEPENDS += "${QADEPENDS}"
-PACKAGEFUNCS += " do_package_qa "
+#PACKAGEFUNCS += " do_package_qa "
 
 # unsafe-references-in-binaries requires prelink-rtld from
 # prelink-native, but we don't want this DEPENDS for -native builds
@@ -654,6 +654,15 @@ def package_qa_walk(path, warnfuncs, errorfuncs, skip, package, d):
     target_os   = d.getVar('TARGET_OS', True)
     target_arch = d.getVar('TARGET_ARCH', True)
 
+    pkgfiles = {}
+    packages = d.getVar('PACKAGES', True).split()
+    pkgdest = d.getVar('PKGDEST', True)
+    for pkg in packages:
+        pkgfiles[pkg] = []
+        for walkroot, dirs, files in os.walk(pkgdest + "/" + pkg):
+            for file in files:
+                pkgfiles[pkg].append(walkroot + os.sep + file)
+
     warnings = []
     errors = []
     for path in pkgfiles[package]:
@@ -823,6 +832,8 @@ python do_package_qa () {
     bb.note("DONE with PACKAGE QA")
 }
 
+addtask package_qa after do_package before do_build
+EXPORT_FUNCTIONS do_package_qa
 
 python do_qa_staging() {
     bb.note("QA checking staging")
-- 
1.7.5.4





More information about the Openembedded-core mailing list