diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-07-15 19:17:44 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-07-18 21:23:43 +0100 |
commit | 77742dd0c977202f29087dd795554e8fe9c00ec5 (patch) | |
tree | b0ea3a457972faaf7d4ffdc20d60bce680e67734 /meta/classes/insane.bbclass | |
parent | 20d7b27b8fc86a001a6f0f1230b13641d0ed74e8 (diff) | |
download | poky-77742dd0c977202f29087dd795554e8fe9c00ec5.tar.gz |
classes/insane: allow libdir QA check to be skipped using INSANE_SKIP
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].
(From OE-Core rev: 3bdbec1bdecc52828cbbf8108786ff076c981845)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r-- | meta/classes/insane.bbclass | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index b875ac08c1..75bd2e2b22 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
@@ -252,29 +252,39 @@ def package_qa_check_libdir(d): | |||
252 | """ | 252 | """ |
253 | import re | 253 | import re |
254 | 254 | ||
255 | pkgd = d.getVar('PKGD', True) | 255 | pkgdest = d.getVar('PKGDEST', True) |
256 | base_libdir = d.getVar("base_libdir",True) + os.sep | 256 | base_libdir = d.getVar("base_libdir",True) + os.sep |
257 | libdir = d.getVar("libdir", True) + os.sep | 257 | libdir = d.getVar("libdir", True) + os.sep |
258 | exec_prefix = d.getVar("exec_prefix", True) + os.sep | 258 | exec_prefix = d.getVar("exec_prefix", True) + os.sep |
259 | 259 | ||
260 | messages = [] | 260 | messages = [] |
261 | my_files = [] | ||
262 | |||
263 | for root, dirs, files in os.walk(pkgd): | ||
264 | for file in files: | ||
265 | full_path = os.path.join(root,file) | ||
266 | my_files.append(full_path[len(pkgd):]) | ||
267 | 261 | ||
268 | lib_re = re.compile("^/lib.+\.so(\..+)?$") | 262 | lib_re = re.compile("^/lib.+\.so(\..+)?$") |
269 | exec_re = re.compile("^%s.*/lib.+\.so(\..+)?$" % exec_prefix) | 263 | exec_re = re.compile("^%s.*/lib.+\.so(\..+)?$" % exec_prefix) |
270 | 264 | ||
271 | for file in my_files: | 265 | for root, dirs, files in os.walk(pkgdest): |
272 | if lib_re.match(file): | 266 | if root == pkgdest: |
273 | if base_libdir not in file: | 267 | # Skip subdirectories for any packages with libdir in INSANE_SKIP |
274 | messages.append("Found library in wrong location: %s" % file) | 268 | skippackages = [] |
275 | if exec_re.match(file): | 269 | for package in dirs: |
276 | if libdir not in file: | 270 | if 'libdir' in (d.getVar('INSANE_SKIP_' + package, True) or "").split(): |
277 | messages.append("Found library in wrong location: %s" % file) | 271 | bb.note("Package %s skipping libdir QA test" % (package)) |
272 | skippackages.append(package) | ||
273 | for package in skippackages: | ||
274 | dirs.remove(package) | ||
275 | for file in files: | ||
276 | full_path = os.path.join(root, file) | ||
277 | rel_path = os.path.relpath(full_path, pkgdest) | ||
278 | if os.sep in rel_path: | ||
279 | package, rel_path = rel_path.split(os.sep, 1) | ||
280 | rel_path = os.sep + rel_path | ||
281 | if lib_re.match(rel_path): | ||
282 | if base_libdir not in rel_path: | ||
283 | messages.append("%s: found library in wrong location: %s" % (package, rel_path)) | ||
284 | if exec_re.match(rel_path): | ||
285 | if libdir not in rel_path: | ||
286 | messages.append("%s: found library in wrong location: %s" % (package, rel_path)) | ||
287 | |||
278 | if messages: | 288 | if messages: |
279 | package_qa_handle_error("libdir", "\n".join(messages), d) | 289 | package_qa_handle_error("libdir", "\n".join(messages), d) |
280 | 290 | ||