Files
meta-external-toolchain/classes/blacklist_dynamic.bbclass
Christopher Larson 07ee6ebdb5 blacklist_dynamic.bbclass: use getVar, not expand, for PNBLACKLIST_DYNAMIC
This ensures that _append/_prepend/_remove are also applied, so the user
can remove elements from the variable.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
2018-03-03 01:18:30 +05:00

44 lines
1.4 KiB
Plaintext

# Blacklist recipe names which include variable references, handling
# multilibs.
#
# Ex.
# PNBLACKLIST_DYNAMIC += "${MLPREFIX}gcc-cross-${TARGET_ARCH}"
# PNBLACKLIST_DYNAMIC += "gcc-source-${@'${GCCVERSION}'.replace('%', '')}"
PNBLACKLIST_DYNAMIC ?= ""
inherit blacklist
python pnblacklist_dynamic_setup () {
d = e.data
blacklisted = d.getVar('PNBLACKLIST_DYNAMIC', False)
if not blacklisted.strip():
return
multilibs = d.getVar('MULTILIBS', True) or ''
# this block has been copied from base.bbclass so keep it in sync
prefixes = []
for ext in multilibs.split():
eext = ext.split(':')
if len(eext) > 1 and eext[0] == 'multilib':
prefixes.append(eext[1])
to_blacklist = set()
for prefix in [''] + prefixes:
localdata = bb.data.createCopy(d)
if prefix:
localdata.setVar('MLPREFIX', prefix + '-')
override = ':virtclass-multilib-' + prefix
localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override)
bb.data.update_data(localdata)
to_blacklist |= set(filter(None, localdata.getVar('PNBLACKLIST_DYNAMIC').split()))
for blrecipe in to_blacklist:
d.setVarFlag('PNBLACKLIST', blrecipe, 'blacklisted by PNBLACKLIST_DYNAMIC')
}
pnblacklist_dynamic_setup[eventmask] = "bb.event.ConfigParsed"
addhandler pnblacklist_dynamic_setup