summaryrefslogtreecommitdiff
path: root/meta/classes/distro_features_check.bbclass
blob: 61b11b7d53a0171e8b27cf687c7d484a652e7d75 (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
# Allow checking of required and conflicting DISTRO_FEATURES
#
# REQUIRED_DISTRO_FEATURES: ensure every item on this list is included
#                           in DISTRO_FEATURES.
# CONFLICT_DISTRO_FEATURES: ensure no item in this list is included in
#                           DISTRO_FEATURES.
#
# Copyright 2013 (C) O.S. Systems Software LTDA.

python () {
    required_distro_features = d.getVar('REQUIRED_DISTRO_FEATURES', True)
    if required_distro_features:
        required_distro_features = required_distro_features.split()
        distro_features = (d.getVar('DISTRO_FEATURES', True) or "").split()
        for f in required_distro_features:
            if f in distro_features:
                break
        else:
            raise bb.parse.SkipPackage("missing required distro feature %s (not in DISTRO_FEATURES)" % required_distro_features)

    conflict_distro_features = d.getVar('CONFLICT_DISTRO_FEATURES', True)
    if conflict_distro_features:
        conflict_distro_features = conflict_distro_features.split()
        distro_features = (d.getVar('DISTRO_FEATURES', True) or "").split()
        for f in conflict_distro_features:
            if f in distro_features:
                raise bb.parse.SkipPackage("conflicting distro feature %s (in DISTRO_FEATURES)" % conflict_distro_features)
}