diff options
author | Joshua Lock <josh@linux.intel.com> | 2009-12-19 12:29:14 +0000 |
---|---|---|
committer | Joshua Lock <josh@linux.intel.com> | 2009-12-21 10:51:50 +0000 |
commit | 2be65803cbb16ce4b20b0b3b20db3581c5ff0f57 (patch) | |
tree | d0047ab4b155f4d3ed7263f168ddeb20eadfa6dc /meta/classes/insane.bbclass | |
parent | 52b821a3844635c25de30d2c849b1bdfbfead85a (diff) | |
download | openembedded-core-2be65803cbb16ce4b20b0b3b20db3581c5ff0f57.tar.gz openembedded-core-2be65803cbb16ce4b20b0b3b20db3581c5ff0f57.tar.bz2 openembedded-core-2be65803cbb16ce4b20b0b3b20db3581c5ff0f57.tar.xz openembedded-core-2be65803cbb16ce4b20b0b3b20db3581c5ff0f57.zip |
insane.bbclass: Fix gettext test
The previous gettext check was broken resulting in many false positives.
This improved version works as follows:
* Adds to the existing os.walk() and builds a list of configure.in and
configure.ac files
* Tests whether DEPENDS includes an appropriate gettext
* If not greps the configure files in the list for instances of AM_GNU_GETTEXT
* If if an instance is found we bb.fatal with an appropriate message
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r-- | meta/classes/insane.bbclass | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 706fc3c22..9fc8873f2 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -439,23 +439,6 @@ def package_qa_check_rdepends(pkg, workdir, d): return sane -def configure_qa_check_gettext(d): - # Check to see if gettext is required and if so whether it's in DEPENDS - # Returning False means we need gettext but don't have it in DEPENDS - if bb.data.inherits_class('native', d): - gt = "gettext-native" - else: - gt = "gettext" - deps = bb.utils.explode_deps(bb.data.getVar('DEPENDS', d, True) or "") - if gt in deps: - return True - - check = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" $CONFIGURE_AC >/dev/null" - if os.system(check) == 0: - return True - else: - return False - # The PACKAGE FUNC to scan each package python do_package_qa () { bb.note("DO PACKAGE QA") @@ -502,11 +485,8 @@ python do_qa_staging() { # have it in DEPENDS addtask qa_configure after do_configure before do_compile python do_qa_configure() { - bb.note("Checking for gettext requirement") - if not configure_qa_check_gettext(d): - bb.fatal("Gettext required by configure but not in DEPENDS") - - bb.note("Checking sanity of the config.log file") + configs = [] + bb.note("Checking autotools environment for common misconfiguration") for root, dirs, files in os.walk(bb.data.getVar('WORKDIR', d, True)): statement = "grep 'CROSS COMPILE Badness:' %s > /dev/null" % \ os.path.join(root,"config.log") @@ -514,4 +494,20 @@ python do_qa_configure() { if os.system(statement) == 0: bb.fatal("""This autoconf log indicates errors, it looked at host includes. Rerun configure task after fixing this. The path was '%s'""" % root) + + if "configure.ac" in files: + configs.append(os.path.join(root,"configure.ac")) + if "configure.in" in files: + configs.append(os.path.join(root, "configure.in")) + + if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('nativesdk', d): + gt = "gettext-native" + else: + gt = "gettext" + deps = bb.utils.explode_deps(bb.data.getVar('DEPENDS', d, True) or "") + if gt not in deps: + for config in configs: + gnu = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" %s >/dev/null" % config + if os.system(gnu) == 0: + bb.fatal("Gettext required but not in DEPENDS for file %s" % config) } |