summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-07-15 19:17:44 +0100
committerSaul Wold <sgw@linux.intel.com>2013-07-18 07:14:40 -0700
commit3bdbec1bdecc52828cbbf8108786ff076c981845 (patch)
tree7e067c979c6030bfc689ccb9af36c36e15155987
parent194e47e6d8d9b9ee98e0203f0ebb574084277c46 (diff)
downloadopenembedded-core-contrib-3bdbec1bdecc52828cbbf8108786ff076c981845.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]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
-rw-r--r--meta/classes/insane.bbclass38
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):
"""
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)
>233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514