summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-02 11:37:07 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-02 11:40:53 +0100
commit5fdbda6922327d963d4fe1c597fed8f0dfd20ed1 (patch)
tree98e3a58efeaead2fa76110b571cfda3f63414277 /meta/classes/insane.bbclass
parent0bfb2094e3eadc85358a354d12b211ff69612a61 (diff)
downloadpoky-5fdbda6922327d963d4fe1c597fed8f0dfd20ed1.tar.gz
classes: Update to use corrected bb.utils.explode_dep_versions2 API
The bb.utils.explode_dep_versions function has issues where dependency information can be lost. The API doesn't support maintaining the correct information so this changes to use a new function which correctly handles the data. This patch also fixes various points in the code to ensure that we do not have any duplicates in things that use explode_dep_versions. A new sanity test to test the contents of the R* variables is also added. [Some changes from Mark Hatle <mark.hatle@windriver.com>] (From OE-Core rev: 16a892431d0c0d03f8b561b92909cf2f11af4918) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r--meta/classes/insane.bbclass44
1 files changed, 42 insertions, 2 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index b1e68b23fc..4f87c937ad 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -114,7 +114,7 @@ def package_qa_get_machine_dict():
114 114
115# Currently not being used by default "desktop" 115# Currently not being used by default "desktop"
116WARN_QA ?= "ldflags useless-rpaths rpaths unsafe-references-in-binaries unsafe-references-in-scripts staticdev libdir" 116WARN_QA ?= "ldflags useless-rpaths rpaths unsafe-references-in-binaries unsafe-references-in-scripts staticdev libdir"
117ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch la2 pkgconfig la perms" 117ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch la2 pkgconfig la perms dep-cmp"
118 118
119ALL_QA = "${WARN_QA} ${ERROR_QA}" 119ALL_QA = "${WARN_QA} ${ERROR_QA}"
120 120
@@ -646,6 +646,43 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, d):
646 646
647 return sane 647 return sane
648 648
649def package_qa_check_deps(pkg, pkgdest, skip, d):
650 sane = True
651
652 localdata = bb.data.createCopy(d)
653 localdata.setVar('OVERRIDES', pkg)
654 bb.data.update_data(localdata)
655
656 def check_valid_deps(var):
657 sane = True
658 try:
659 rvar = bb.utils.explode_dep_versions2(localdata.getVar(var, True) or "")
660 except ValueError as e:
661 bb.fatal("%s_%s: %s" % (var, pkg, e))
662 raise e
663 for dep in rvar:
664 for v in rvar[dep]:
665 if v and not v.startswith(('< ', '= ', '> ', '<= ', '>=')):
666 error_msg = "%s_%s is invalid: %s (%s) only comparisons <, =, >, <=, and >= are allowed" % (var, pkg, dep, v)
667 sane = package_qa_handle_error("dep-cmp", error_msg, d)
668 return sane
669
670 sane = True
671 if not check_valid_deps('RDEPENDS'):
672 sane = False
673 if not check_valid_deps('RRECOMMENDS'):
674 sane = False
675 if not check_valid_deps('RSUGGESTS'):
676 sane = False
677 if not check_valid_deps('RPROVIDES'):
678 sane = False
679 if not check_valid_deps('RREPLACES'):
680 sane = False
681 if not check_valid_deps('RCONFLICTS'):
682 sane = False
683
684 return sane
685
649# The PACKAGE FUNC to scan each package 686# The PACKAGE FUNC to scan each package
650python do_package_qa () { 687python do_package_qa () {
651 import subprocess 688 import subprocess
@@ -686,6 +723,7 @@ python do_package_qa () {
686 g = globals() 723 g = globals()
687 walk_sane = True 724 walk_sane = True
688 rdepends_sane = True 725 rdepends_sane = True
726 deps_sane = True
689 for package in packages.split(): 727 for package in packages.split():
690 skip = (d.getVar('INSANE_SKIP_' + package, True) or "").split() 728 skip = (d.getVar('INSANE_SKIP_' + package, True) or "").split()
691 if skip: 729 if skip:
@@ -709,12 +747,14 @@ python do_package_qa () {
709 walk_sane = False 747 walk_sane = False
710 if not package_qa_check_rdepends(package, pkgdest, skip, d): 748 if not package_qa_check_rdepends(package, pkgdest, skip, d):
711 rdepends_sane = False 749 rdepends_sane = False
750 if not package_qa_check_deps(package, pkgdest, skip, d):
751 deps_sane = False
712 752
713 753
714 if 'libdir' in d.getVar("ALL_QA", True).split(): 754 if 'libdir' in d.getVar("ALL_QA", True).split():
715 package_qa_check_libdir(d) 755 package_qa_check_libdir(d)
716 756
717 if not walk_sane or not rdepends_sane: 757 if not walk_sane or not rdepends_sane or not deps_sane:
718 bb.fatal("QA run found fatal errors. Please consider fixing them.") 758 bb.fatal("QA run found fatal errors. Please consider fixing them.")
719 bb.note("DONE with PACKAGE QA") 759 bb.note("DONE with PACKAGE QA")
720} 760}