summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
diff options
context:
space:
mode:
authorAlejandro Hernandez <alejandro.hernandez@linux.intel.com>2015-04-09 16:55:58 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-13 22:33:19 +0100
commit1521a3dda0a6ebcedb52f4a410f705c8d68d0a11 (patch)
treec5db6d313dbb9814613df31bbeae479f959bc8cd /meta/classes/insane.bbclass
parent86cbe081a503056f27318f78f73749e8f3bf365e (diff)
downloadpoky-1521a3dda0a6ebcedb52f4a410f705c8d68d0a11.tar.gz
insane.bbclass: Enhance file-rdeps QA check
Adds symlink-to-sysroot check to QA_WARN to detect symlinks that point to locations under TMPDIR, which are most likely broken. Changes filerdepends from set() to dict(), hence methods for adding or deleting items had to change too. Now it keeps track of key:value relationship, flags the QA issue; warning the user about which file/package causes the problem, making it easier to debug. [YOCTO #7126] (From OE-Core rev: 9946909dc95c3274a98112cf786d171547b3ed75) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@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.bbclass26
1 files changed, 11 insertions, 15 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index ab7ca3b64b..3592575d73 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -30,7 +30,7 @@ WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
30 textrel already-stripped incompatible-license files-invalid \ 30 textrel already-stripped incompatible-license files-invalid \
31 installed-vs-shipped compile-host-path install-host-path \ 31 installed-vs-shipped compile-host-path install-host-path \
32 pn-overrides infodir build-deps file-rdeps \ 32 pn-overrides infodir build-deps file-rdeps \
33 unknown-configure-option \ 33 unknown-configure-option symlink-to-sysroot \
34 " 34 "
35ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ 35ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
36 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \ 36 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -612,7 +612,6 @@ def package_qa_check_symlink_to_sysroot(path, name, d, elf, messages):
612 if target.startswith(tmpdir): 612 if target.startswith(tmpdir):
613 trimmed = path.replace(os.path.join (d.getVar("PKGDEST", True), name), "") 613 trimmed = path.replace(os.path.join (d.getVar("PKGDEST", True), name), "")
614 messages["symlink-to-sysroot"] = "Symlink %s in %s points to TMPDIR" % (trimmed, name) 614 messages["symlink-to-sysroot"] = "Symlink %s in %s points to TMPDIR" % (trimmed, name)
615
616def package_qa_check_license(workdir, d): 615def package_qa_check_license(workdir, d):
617 """ 616 """
618 Check for changes in the license files 617 Check for changes in the license files
@@ -811,13 +810,14 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d):
811 if bb.data.inherits_class('nativesdk', d): 810 if bb.data.inherits_class('nativesdk', d):
812 ignored_file_rdeps |= set(['/bin/bash', '/usr/bin/perl']) 811 ignored_file_rdeps |= set(['/bin/bash', '/usr/bin/perl'])
813 # For Saving the FILERDEPENDS 812 # For Saving the FILERDEPENDS
814 filerdepends = set() 813 filerdepends = {}
815 rdep_data = oe.packagedata.read_subpkgdata(pkg, d) 814 rdep_data = oe.packagedata.read_subpkgdata(pkg, d)
816 for key in rdep_data: 815 for key in rdep_data:
817 if key.startswith("FILERDEPENDS_"): 816 if key.startswith("FILERDEPENDS_"):
818 for subkey in rdep_data[key].split(): 817 for subkey in rdep_data[key].split():
819 filerdepends.add(subkey) 818 if subkey not in ignored_file_rdeps:
820 filerdepends -= ignored_file_rdeps 819 # We already know it starts with FILERDEPENDS_
820 filerdepends[subkey] = key[13:]
821 821
822 if filerdepends: 822 if filerdepends:
823 next = rdepends 823 next = rdepends
@@ -849,31 +849,27 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d):
849 # case there is a RDEPENDS_pkg = "python" in the recipe. 849 # case there is a RDEPENDS_pkg = "python" in the recipe.
850 for py in [ d.getVar('MLPREFIX', True) + "python", "python" ]: 850 for py in [ d.getVar('MLPREFIX', True) + "python", "python" ]:
851 if py in done: 851 if py in done:
852 filerdepends.discard("/usr/bin/python") 852 filerdepends.pop("/usr/bin/python",None)
853 done.remove(py) 853 done.remove(py)
854 for rdep in done: 854 for rdep in done:
855 # For Saving the FILERPROVIDES, RPROVIDES and FILES_INFO 855 # For Saving the FILERPROVIDES, RPROVIDES and FILES_INFO
856 rdep_rprovides = set()
857 rdep_data = oe.packagedata.read_subpkgdata(rdep, d) 856 rdep_data = oe.packagedata.read_subpkgdata(rdep, d)
858 for key in rdep_data: 857 for key in rdep_data:
859 if key.startswith("FILERPROVIDES_") or key.startswith("RPROVIDES_"): 858 if key.startswith("FILERPROVIDES_") or key.startswith("RPROVIDES_"):
860 for subkey in rdep_data[key].split(): 859 for subkey in rdep_data[key].split():
861 rdep_rprovides.add(subkey) 860 filerdepends.pop(subkey,None)
862 # Add the files list to the rprovides 861 # Add the files list to the rprovides
863 if key == "FILES_INFO": 862 if key == "FILES_INFO":
864 # Use eval() to make it as a dict 863 # Use eval() to make it as a dict
865 for subkey in eval(rdep_data[key]): 864 for subkey in eval(rdep_data[key]):
866 rdep_rprovides.add(subkey) 865 filerdepends.pop(subkey,None)
867 filerdepends -= rdep_rprovides
868 if not filerdepends: 866 if not filerdepends:
869 # Break if all the file rdepends are met 867 # Break if all the file rdepends are met
870 break 868 break
871 else:
872 # Clear it for the next loop
873 rdep_rprovides.clear()
874 if filerdepends: 869 if filerdepends:
875 error_msg = "%s requires %s, but no providers in its RDEPENDS" % \ 870 for key in filerdepends:
876 (pkg, ', '.join(str(e) for e in filerdepends)) 871 error_msg = "%s contained in package %s requires %s, but no providers found in its RDEPENDS" % \
872 (filerdepends[key],pkg, key)
877 sane = package_qa_handle_error("file-rdeps", error_msg, d) 873 sane = package_qa_handle_error("file-rdeps", error_msg, d)
878 874
879 return sane 875 return sane