On 2015-11-19 09:42, Gary Thomas wrote:
I have a recipe that needs to make sure a global setting is
in place (used by a different recipe).  How can I test for
this variable/setting in my recipe and issue a warning/error
if it is not?

Thanks for any ideas


Never mind - it occurred to me to see if some other recipe had
such checks and I found some and was able to add this to my recipe:

# Make sure SPI will is enabled
python do_check_variables() {
    ENABLE_SPI_BUS = d.getVar('ENABLE_SPI_BUS', True)
    if ENABLE_SPI_BUS != '1':
       bb.fatal("PiFace module can't work without SPI support - Add 
ENABLE_SPI_BUS='1' to local.conf")
}
addtask check_variables before do_fetch

Not sure if this is the best way but it suffices.

--
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to