aboutsummaryrefslogtreecommitdiffstats
path: root/classes/skip_recipe_dynamic.bbclass
blob: 4a17e717b3c0c2e27e2a32747869e8ae5d5cb813 (plain)
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
# Skip recipes for names which include variable references, handling multilibs.
#
# Ex.
#     SKIP_RECIPE_DYNAMIC += "${MLPREFIX}gcc-cross-${TARGET_ARCH}"
#     SKIP_RECIPE_DYNAMIC += "gcc-source-${@'${GCCVERSION}'.replace('%', '')}"

SKIP_RECIPE_DYNAMIC ?= ""

python skip_recipe_dynamic_setup () {
    d = e.data

    blacklisted = d.getVar('SKIP_RECIPE_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)

        to_blacklist |= set(filter(None, localdata.getVar('SKIP_RECIPE_DYNAMIC').split()))

    for blrecipe in to_blacklist:
        d.setVarFlag('SKIP_RECIPE', blrecipe, 'skipped by SKIP_RECIPE_DYNAMIC')
}
skip_recipe_dynamic_setup[eventmask] = "bb.event.ConfigParsed"
addhandler skip_recipe_dynamic_setup