Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] A couple more fixes for the libdir QA check
@ 2013-07-15 18:17 Paul Eggleton
  2013-07-15 18:17 ` [PATCH 1/2] classes/insane: fix regression in libdir QA regex Paul Eggleton
  2013-07-15 18:17 ` [PATCH 2/2] classes/insane: allow libdir QA check to be skipped using INSANE_SKIP Paul Eggleton
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2013-07-15 18:17 UTC (permalink / raw)
  To: openembedded-core


The following changes since commit 43c28375f97161e618fa54349c65be2058c33c53:

  distrodata.bbaclass: change in git and svn package reporting (2013-07-12 10:12:13 -0700)

are available in the git repository at:

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

Paul Eggleton (2):
  classes/insane: fix regression in libdir QA regex
  classes/insane: allow libdir QA check to be skipped using INSANE_SKIP

 meta/classes/insane.bbclass | 40 +++++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 15 deletions(-)

-- 
1.8.1.2



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] classes/insane: fix regression in libdir QA regex
  2013-07-15 18:17 [PATCH 0/2] A couple more fixes for the libdir QA check Paul Eggleton
@ 2013-07-15 18:17 ` Paul Eggleton
  2013-07-15 18:17 ` [PATCH 2/2] classes/insane: allow libdir QA check to be skipped using INSANE_SKIP Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2013-07-15 18:17 UTC (permalink / raw)
  To: openembedded-core

There was a slight mistake in the recent change to the lib_re regex -
it still needs to begin with a /.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/insane.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 1023092..b875ac0 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -265,7 +265,7 @@ def package_qa_check_libdir(d):
             full_path = os.path.join(root,file)
             my_files.append(full_path[len(pkgd):])
 
-    lib_re = re.compile("^lib.+\.so(\..+)?$")
+    lib_re = re.compile("^/lib.+\.so(\..+)?$")
     exec_re = re.compile("^%s.*/lib.+\.so(\..+)?$" % exec_prefix)
 
     for file in my_files:
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] classes/insane: allow libdir QA check to be skipped using INSANE_SKIP
  2013-07-15 18:17 [PATCH 0/2] A couple more fixes for the libdir QA check Paul Eggleton
  2013-07-15 18:17 ` [PATCH 1/2] classes/insane: fix regression in libdir QA regex Paul Eggleton
@ 2013-07-15 18:17 ` Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2013-07-15 18:17 UTC (permalink / raw)
  To: openembedded-core

This path check isn't handled in the normal way where a QA check
function is called for every file (there's some minor setup that we want
to avoid doing for every file) so we need to check INSANE_SKIP
explicitly.

In the process, change the code structure a little bit so that we can
report the package that contains the errant file.

Fixes [YOCTO #4822].

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

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index b875ac0..75bd2e2 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -252,29 +252,39 @@ def package_qa_check_libdir(d):
     """
     import re
 
-    pkgd = d.getVar('PKGD', True)
+    pkgdest = d.getVar('PKGDEST', True)
     base_libdir = d.getVar("base_libdir",True) + os.sep
     libdir = d.getVar("libdir", True) + os.sep
     exec_prefix = d.getVar("exec_prefix", True) + os.sep
 
     messages = []
-    my_files = []
-
-    for root, dirs, files in os.walk(pkgd):
-        for file in files:
-            full_path = os.path.join(root,file)
-            my_files.append(full_path[len(pkgd):])
 
     lib_re = re.compile("^/lib.+\.so(\..+)?$")
     exec_re = re.compile("^%s.*/lib.+\.so(\..+)?$" % exec_prefix)
 
-    for file in my_files:
-        if lib_re.match(file):
-            if base_libdir not in file:
-                messages.append("Found library in wrong location: %s" % file)
-        if exec_re.match(file):
-            if libdir not in file:
-                messages.append("Found library in wrong location: %s" % file)
+    for root, dirs, files in os.walk(pkgdest):
+        if root == pkgdest:
+            # Skip subdirectories for any packages with libdir in INSANE_SKIP
+            skippackages = []
+            for package in dirs:
+                if 'libdir' in (d.getVar('INSANE_SKIP_' + package, True) or "").split():
+                    bb.note("Package %s skipping libdir QA test" % (package))
+                    skippackages.append(package)
+            for package in skippackages:
+                dirs.remove(package)
+        for file in files:
+            full_path = os.path.join(root, file)
+            rel_path = os.path.relpath(full_path, pkgdest)
+            if os.sep in rel_path:
+                package, rel_path = rel_path.split(os.sep, 1)
+                rel_path = os.sep + rel_path
+                if lib_re.match(rel_path):
+                    if base_libdir not in rel_path:
+                        messages.append("%s: found library in wrong location: %s" % (package, rel_path))
+                if exec_re.match(rel_path):
+                    if libdir not in rel_path:
+                        messages.append("%s: found library in wrong location: %s" % (package, rel_path))
+
     if messages:
         package_qa_handle_error("libdir", "\n".join(messages), d)
 
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-15 18:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-15 18:17 [PATCH 0/2] A couple more fixes for the libdir QA check Paul Eggleton
2013-07-15 18:17 ` [PATCH 1/2] classes/insane: fix regression in libdir QA regex Paul Eggleton
2013-07-15 18:17 ` [PATCH 2/2] classes/insane: allow libdir QA check to be skipped using INSANE_SKIP Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox