Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 5/9] Move check that all installed files are shipped into insane.bbclass
Date: Tue, 13 Dec 2011 20:19:49 +0400	[thread overview]
Message-ID: <1323793193-31090-5-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1323793193-31090-1-git-send-email-dbaryshkov@gmail.com>

Checking that all installed files are shipped is in reality a QA check.
It would benefit from mechanisms like ERROR_QA/WARNING_QA. So move it
into insane.bbclass. If some of the files are installed but should not
be shipped for some reasons, one can add them to the variable
IGNORE_UNSHIPPED_FILES.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 meta/classes/insane.bbclass  |   49 ++++++++++++++++++++++++++++++++++++++++-
 meta/classes/package.bbclass |   15 ------------
 2 files changed, 47 insertions(+), 17 deletions(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 5726e69..7a8643a 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -100,7 +100,7 @@ def package_qa_get_machine_dict():
 
 
 # Currently not being used by default "desktop"
-WARN_QA ?= "ldflags useless-rpaths rpaths"
+WARN_QA ?= "ldflags useless-rpaths rpaths unshipped"
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch la2 pkgconfig la perms"
 
 def package_qa_clean_path(path,d):
@@ -485,6 +485,48 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, d):
 
     return sane
 
+IGNORE_UNSHIPPED_FILES ??= ""
+
+def packages_qa_unshipped_files(d):
+    skip = (d.getVar('INSANE_SKIP_${PN}', True) or "").split()
+    if "unshipped" in skip:
+        return False
+
+    seen = d.getVar('IGNORE_UNSHIPPED_FILES', True).split()
+    unshipped = []
+    dvar = d.getVar('PKGD', True)
+    destvar = d.getVar('PKGDEST', True)
+    packages = d.getVar('PACKAGES', True).split()
+    for p in packages:
+        pdir = os.path.join(destvar, p)
+        for root, dirs, files in os.walk(pdir):
+            dir = root[len(pdir):]
+            if not dir:
+                dir = os.sep
+            for f in (files + dirs):
+                path = os.path.join(dir, f)
+                if path not in seen:
+                    seen.append(path)
+
+    for root, dirs, files in os.walk(dvar):
+        dir = root[len(dvar):]
+        if not dir:
+            dir = os.sep
+        for f in (files + dirs):
+            path = os.path.join(dir, f)
+            if path not in seen:
+                unshipped.append(path)
+
+    pn = d.getVar('PN', True)
+
+    if unshipped == []:
+        return True
+
+    ret = package_qa_handle_error("unshipped", "For recipe %s, the following files/directories were installed but not shipped in any package:" % pn, d)
+    for f in unshipped:
+        package_qa_handle_error("unshipped", f, d)
+    return ret
+
 # The PACKAGE FUNC to scan each package
 python do_package_qa () {
     bb.note("DO PACKAGE QA")
@@ -522,6 +564,7 @@ python do_package_qa () {
     g = globals()
     walk_sane = True
     rdepends_sane = True
+    shipped_sane = True
     for package in packages.split():
         skip = (d.getVar('INSANE_SKIP_' + package, True) or "").split()
         if skip:
@@ -546,8 +589,10 @@ python do_package_qa () {
         if not package_qa_check_rdepends(package, pkgdest, skip, d):
             rdepends_sane = False
 
+    if not packages_qa_unshipped_files(d):
+        shipped_sane = False
 
-    if not walk_sane or not rdepends_sane:
+    if not walk_sane or not rdepends_sane or not shipped_sane:
         bb.fatal("QA run found fatal errors. Please consider fixing them.")
     bb.note("DONE with PACKAGE QA")
 }
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 39c1d4b..fbea9c6 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -957,21 +957,6 @@ python populate_packages () {
 		del localdata
 	os.chdir(workdir)
 
-	unshipped = []
-	for root, dirs, files in os.walk(dvar):
-		dir = root[len(dvar):]
-		if not dir:
-			dir = os.sep
-		for f in (files + dirs):
-			path = os.path.join(dir, f)
-			if ('.' + path) not in seen:
-				unshipped.append(path)
-
-	if unshipped != []:
-		bb.warn("For recipe %s, the following files/directories were installed but not shipped in any package:" % pn)
-		for f in unshipped:
-			bb.warn("  " + f)
-
 	bb.build.exec_func("package_name_hook", d)
 
 	for pkg in package_list:
-- 
1.7.7.3




  parent reply	other threads:[~2011-12-13 16:28 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 16:19 [PATCH 1/9] kernel.bbclass: compile kernel and modules in a single task Dmitry Eremin-Solenikov
2011-12-13 16:19 ` [PATCH 2/9] kernel.bbclass: move uImage handling to separate task Dmitry Eremin-Solenikov
2011-12-14 21:20   ` Koen Kooi
2011-12-15  6:23     ` Dmitry Eremin-Solenikov
2011-12-15 13:55       ` Bruce Ashfield
2011-12-15 19:09         ` Tom Rini
2011-12-15 19:20           ` Bruce Ashfield
2011-12-13 16:19 ` [PATCH 3/9] bitbake.conf, core-image-minimal-initramfs: add INITRAMFS_FSTYPES Dmitry Eremin-Solenikov
2011-12-16 16:16   ` Richard Purdie
2011-12-13 16:19 ` [PATCH 4/9] consolekit: fix sdk generation issues Dmitry Eremin-Solenikov
2011-12-15 14:58   ` Richard Purdie
2011-12-15 15:06     ` Koen Kooi
2011-12-16  1:56       ` Cui, Dexuan
2011-12-16 12:42       ` Dmitry Eremin-Solenikov
2011-12-15 16:20     ` Cui, Dexuan
2011-12-16 12:42       ` Dmitry Eremin-Solenikov
2011-12-16 15:25         ` Richard Purdie
2011-12-16 16:07           ` Dmitry Eremin-Solenikov
2011-12-16 16:46             ` Richard Purdie
2011-12-16 17:55               ` Dmitry Eremin-Solenikov
2011-12-13 16:19 ` Dmitry Eremin-Solenikov [this message]
2011-12-13 16:27   ` [PATCH 5/9] Move check that all installed files are shipped into insane.bbclass Phil Blundell
2011-12-13 16:52     ` Dmitry Eremin-Solenikov
2011-12-15 14:55   ` Richard Purdie
2011-12-13 16:19 ` [PATCH 6/9] libgcc: reintroduce debug package, containing symbols Dmitry Eremin-Solenikov
2011-12-16 16:17   ` Richard Purdie
2011-12-13 16:19 ` [PATCH 7/9] ncurses: drop empty dir to remove QA warning Dmitry Eremin-Solenikov
2011-12-13 19:43   ` Khem Raj
2011-12-13 16:19 ` [PATCH 8/9] readline: drop empty dir to shut up " Dmitry Eremin-Solenikov
2011-12-16 16:17   ` Richard Purdie
2011-12-13 16:19 ` [PATCH 9/9] libatomic-ops: drop directory with documentation to remove " Dmitry Eremin-Solenikov
2011-12-13 19:48   ` Richard Purdie
2011-12-13 22:07     ` Dmitry Eremin-Solenikov
2011-12-15 12:26       ` Richard Purdie
2011-12-13 16:22 ` [PATCH 1/9] kernel.bbclass: compile kernel and modules in a single task Phil Blundell
2011-12-13 16:46   ` Dmitry Eremin-Solenikov
2011-12-14  0:15 ` Darren Hart
2011-12-14  0:17   ` Dmitry Eremin-Solenikov
2011-12-14  0:19     ` Darren Hart
2011-12-15  9:27     ` Koen Kooi
2011-12-15 13:57       ` Bruce Ashfield
2011-12-15 14:56 ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323793193-31090-5-git-send-email-dbaryshkov@gmail.com \
    --to=dbaryshkov@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox