[bitbake-devel] [PATCH 1/1] tinfoil.py: Check if BUILDDIR exists
Paul Eggleton
paul.eggleton at linux.intel.com
Mon Jan 22 20:02:30 UTC 2018
Hi Amanda,
On Saturday, 20 January 2018 9:53:13 AM NZDT Amanda Brindle wrote:
> + basepath = os.environ.get('BUILDDIR')
> + if not basepath:
> + print("Tinfoil can only be run after initialising the build
> environment (e.g. by using oe-init-build-env)")
> + sys.exit(1)
> +
We should be raising an exception here - tinfoil is utility code, it shouldn't
be calling sys.exit(). Additionally, bitbake shouldn't be referring to
oe-init-build-env, that's something from OpenEmbedded; even mentioning Tinfoil
isn't going to be much use to the user. I would simply raise a custom
exception class with the message "Build environment not initialised" or
similar, and if tinfoil-using want to catch that exception and produce a more
friendly message they can fairly easily do so.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
More information about the bitbake-devel
mailing list