diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-03 16:54:00 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-06 13:12:59 +0000 |
commit | 61c51a1a496f5dd3943f03cec245ead13a8bdb53 (patch) | |
tree | 66a42fbfee6edb41e65b4a2c044277fbf81a55c4 /meta/classes | |
parent | bf25dd25c23143cca78aec58d673c0ba579c91e9 (diff) | |
download | poky-61c51a1a496f5dd3943f03cec245ead13a8bdb53.tar.gz |
insane.bbclass: Add pkgvarcheck to check for suboptimal usages of variables
Check through the variables:
'RDEPENDS', 'RRECOMMENDS', 'FILES', 'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm'
and if there is a variable set which isn't package specific, inform the user
of this.
Using these variables without a package suffix is bad practise and complicates
dependencies of packages unnecessarily as well as complicates the code. Lets
convert the remaining issues and then we can take the small performance gain.
(From OE-Core rev: 316228948e65f376f6c5be13ccd0c964ea630edf)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/insane.bbclass | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 5dfa5aaec4..3375a41ff6 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" |
116 | WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi textrel" | 116 | WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi textrel" |
117 | ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch la2 pkgconfig la perms dep-cmp" | 117 | ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch la2 pkgconfig la perms dep-cmp pkgvarcheck" |
118 | 118 | ||
119 | ALL_QA = "${WARN_QA} ${ERROR_QA}" | 119 | ALL_QA = "${WARN_QA} ${ERROR_QA}" |
120 | 120 | ||
@@ -885,4 +885,12 @@ python () { | |||
885 | tests = d.getVar('ALL_QA', True).split() | 885 | tests = d.getVar('ALL_QA', True).split() |
886 | if "desktop" in tests: | 886 | if "desktop" in tests: |
887 | d.appendVar("PACKAGE_DEPENDS", "desktop-file-utils-native") | 887 | d.appendVar("PACKAGE_DEPENDS", "desktop-file-utils-native") |
888 | |||
889 | issues = [] | ||
890 | if (d.getVar('PACKAGES', True) or "").split(): | ||
891 | for var in 'RDEPENDS', 'RRECOMMENDS', 'FILES', 'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm': | ||
892 | if d.getVar(var): | ||
893 | issues.append(var) | ||
894 | for i in issues: | ||
895 | package_qa_handle_error("pkgvarcheck", "%s: Variable %s is set as not being package specific, please fix this." % (d.getVar("FILE", True), i), d) | ||
888 | } | 896 | } |