summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2009-12-19 12:29:14 +0000
committerJoshua Lock <josh@linux.intel.com>2009-12-21 10:51:50 +0000
commit2be65803cbb16ce4b20b0b3b20db3581c5ff0f57 (patch)
treed0047ab4b155f4d3ed7263f168ddeb20eadfa6dc /meta/classes
parent52b821a3844635c25de30d2c849b1bdfbfead85a (diff)
downloadpoky-2be65803cbb16ce4b20b0b3b20db3581c5ff0f57.tar.gz
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')
-rw-r--r--meta/classes/insane.bbclass40
1 files changed, 18 insertions, 22 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 706fc3c227..9fc8873f22 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -439,23 +439,6 @@ def package_qa_check_rdepends(pkg, workdir, d):
439 439
440 return sane 440 return sane
441 441
442def configure_qa_check_gettext(d):
443 # Check to see if gettext is required and if so whether it's in DEPENDS
444 # Returning False means we need gettext but don't have it in DEPENDS
445 if bb.data.inherits_class('native', d):
446 gt = "gettext-native"
447 else:
448 gt = "gettext"
449 deps = bb.utils.explode_deps(bb.data.getVar('DEPENDS', d, True) or "")
450 if gt in deps:
451 return True
452
453 check = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" $CONFIGURE_AC >/dev/null"
454 if os.system(check) == 0:
455 return True
456 else:
457 return False
458
459# The PACKAGE FUNC to scan each package 442# The PACKAGE FUNC to scan each package
460python do_package_qa () { 443python do_package_qa () {
461 bb.note("DO PACKAGE QA") 444 bb.note("DO PACKAGE QA")
@@ -502,11 +485,8 @@ python do_qa_staging() {
502# have it in DEPENDS 485# have it in DEPENDS
503addtask qa_configure after do_configure before do_compile 486addtask qa_configure after do_configure before do_compile
504python do_qa_configure() { 487python do_qa_configure() {
505 bb.note("Checking for gettext requirement") 488 configs = []
506 if not configure_qa_check_gettext(d): 489 bb.note("Checking autotools environment for common misconfiguration")
507 bb.fatal("Gettext required by configure but not in DEPENDS")
508
509 bb.note("Checking sanity of the config.log file")
510 for root, dirs, files in os.walk(bb.data.getVar('WORKDIR', d, True)): 490 for root, dirs, files in os.walk(bb.data.getVar('WORKDIR', d, True)):
511 statement = "grep 'CROSS COMPILE Badness:' %s > /dev/null" % \ 491 statement = "grep 'CROSS COMPILE Badness:' %s > /dev/null" % \
512 os.path.join(root,"config.log") 492 os.path.join(root,"config.log")
@@ -514,4 +494,20 @@ python do_qa_configure() {
514 if os.system(statement) == 0: 494 if os.system(statement) == 0:
515 bb.fatal("""This autoconf log indicates errors, it looked at host includes. 495 bb.fatal("""This autoconf log indicates errors, it looked at host includes.
516Rerun configure task after fixing this. The path was '%s'""" % root) 496Rerun configure task after fixing this. The path was '%s'""" % root)
497
498 if "configure.ac" in files:
499 configs.append(os.path.join(root,"configure.ac"))
500 if "configure.in" in files:
501 configs.append(os.path.join(root, "configure.in"))
502
503 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):
504 gt = "gettext-native"
505 else:
506 gt = "gettext"
507 deps = bb.utils.explode_deps(bb.data.getVar('DEPENDS', d, True) or "")
508 if gt not in deps:
509 for config in configs:
510 gnu = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" %s >/dev/null" % config
511 if os.system(gnu) == 0:
512 bb.fatal("Gettext required but not in DEPENDS for file %s" % config)
517} 513}