[OE-core] [PATCH] insane: configure option checking
Chris Larson
clarson at kergoth.com
Wed Oct 9 23:17:19 UTC 2013
On Tue, Oct 8, 2013 at 7:30 AM, Ross Burton <ross.burton at intel.com> wrote:
> +
> ###########################################################################
> + # Check unrecognised configure options (with a white list)
> +
> ###########################################################################
> + if bb.data.inherits_class("autotools", d):
> + bb.note("Checking configure output for unrecognised options")
> + try:
> + flag = "WARNING: unrecognized options:"
> + log = os.path.join(d.getVar('B', True), 'config.log')
> + output = subprocess.check_output(['grep', '-F', flag, log])
> + options = set(map(lambda s: s.strip(' ,'),
> output.partition(flag)[2].split()))
> + whitelist = set(d.getVar("UNKNOWN_CONFIGURE_WHITELIST",
> True).split())
> + options -= whitelist
> + if options:
> + pn = d.getVar('PN', True)
> + error_msg = pn + ": configure was passed unrecognised
> options: " + " ".join(options)
> + package_qa_handle_error("unknown-configure-option",
> error_msg, d)
> + except subprocess.CalledProcessError:
> + pass
>
Why is the entire block in the try/except rather than just the
subprocess.check_output()?
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20131009/5ea389a9/attachment-0002.html>
More information about the Openembedded-core
mailing list