[OE-core] [PATCH 1/2] scripts: add tool to scan for bashisms recipe shell scripts
Christopher Larson
clarson at kergoth.com
Thu Sep 8 18:29:20 UTC 2016
On Thu, Sep 8, 2016 at 9:58 AM, Ross Burton <ross.burton at intel.com> wrote:
> + fn = tempfile.NamedTemporaryFile(mode="w+t")
> + fn.write(script)
> + fn.flush()
> +
> + try:
> + subprocess.check_output(("checkbashisms.pl", fn.name),
> universal_newlines=True, stderr=subprocess.STDOUT)
> + # No bashisms, so just return
> + return
>
Afaik, you should be using ‘with’ to ensure the temporary files are cleaned
up after use.
--
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/20160908/fc471494/attachment-0002.html>
More information about the Openembedded-core
mailing list