/
blacklist_dynamic.bbclass
43 lines (34 loc) · 1.37 KB
/
blacklist_dynamic.bbclass
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# 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.expand(blacklisted).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