Skip to contentSkip to conversation

variable shared

recipe Sophie Bonnouvrier 2 participants 2 messages Sep 12, 2012

lore
Share & tools
lore
#0 lore raw

hello,

I would like to set a variable in a recipe and used it in another one. but when I get the variable in the second recipe the value is none. How can I shared variable ?

Sophie

recipe 1:
export XENO_DIR = "${@get_xenomai_dir(bb, d)} "
export XENO_PV = "${@get_xenomai_pv(bb, d)} "

recipe 2:
xeno_dir = bb.data.getVar('XENO_DIR',d,1)
xeno_pv = bb.data.getVar('XENO_PV',d,1)

#1 lore raw
Quoted 5 lines · Sophie Bonnouvrier

I would like to set a variable in a recipe and used it in another one. but when I get the variable in the second recipe the value is none. How can I shared variable ?

you have to define such variables in global metadata. any metadata defined in recipe is recipe specific
may be add it to configuration metadata or some sort of abstracted out class.

Quoted 11 lines

Sophie

recipe 1:
export XENO_DIR = "${@get_xenomai_dir(bb, d)} "
export XENO_PV = "${@get_xenomai_pv(bb, d)} "

recipe 2:
xeno_dir = bb.data.getVar('XENO_DIR',d,1)
xeno_pv = bb.data.getVar('XENO_PV',d,1)