From 75ae572427d9cd3f0b3e9e7d4d0e7a93a4f04690 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Tue, 16 Feb 2016 16:27:20 +0000 Subject: insane: wrap autotools checks in inherits_class(autotools) checks There's no point doing the autotools sanity checks if a recipe didn't inherit autotools, so check the inherits before doing the checks. Also pass -F (fixed strings) and -q (quiet) to grep. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/classes/insane.bbclass | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index aef08fe28e..241ad0850b 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -1148,19 +1148,21 @@ python do_qa_configure() { configs = [] workdir = d.getVar('WORKDIR', True) - bb.note("Checking autotools environment for common misconfiguration") - for root, dirs, files in os.walk(workdir): - statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % \ - os.path.join(root,"config.log") - if "config.log" in files: - if subprocess.call(statement, shell=True) == 0: - bb.fatal("""This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities. + + if bb.data.inherits_class('autotools', d): + bb.note("Checking autotools environment for common misconfiguration") + for root, dirs, files in os.walk(workdir): + statement = "grep -q -F -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s" % \ + os.path.join(root,"config.log") + if "config.log" in files: + if subprocess.call(statement, shell=True) == 0: + bb.fatal("""This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities. Rerun configure task after fixing this.""") - 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 "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")) ########################################################################### # Check gettext configuration and dependencies are correct -- cgit 1.2.3-korg