summaryrefslogtreecommitdiffstats
path: root/meta/classes/blacklist.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/blacklist.bbclass')
-rw-r--r--meta/classes/blacklist.bbclass45
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/classes/blacklist.bbclass b/meta/classes/blacklist.bbclass
new file mode 100644
index 0000000000..a0141a82c0
--- /dev/null
+++ b/meta/classes/blacklist.bbclass
@@ -0,0 +1,45 @@
1# anonymous support class from originally from angstrom
2#
3# To use the blacklist, a distribution should include this
4# class in the INHERIT_DISTRO
5#
6# No longer use ANGSTROM_BLACKLIST, instead use a table of
7# recipes in PNBLACKLIST
8#
9# Features:
10#
11# * To add a package to the blacklist, set:
12# PNBLACKLIST[pn] = "message"
13#
14
15# Cope with PNBLACKLIST flags for multilib case
16addhandler blacklist_multilib_eventhandler
17blacklist_multilib_eventhandler[eventmask] = "bb.event.ConfigParsed"
18python blacklist_multilib_eventhandler() {
19 multilibs = e.data.getVar('MULTILIBS', True)
20 if not multilibs:
21 return
22
23 # this block has been copied from base.bbclass so keep it in sync
24 prefixes = []
25 for ext in multilibs.split():
26 eext = ext.split(':')
27 if len(eext) > 1 and eext[0] == 'multilib':
28 prefixes.append(eext[1])
29
30 blacklists = e.data.getVarFlags('PNBLACKLIST') or {}
31 for pkg, reason in blacklists.items():
32 if pkg.endswith(("-native", "-crosssdk")) or pkg.startswith(("nativesdk-", "virtual/nativesdk-")) or 'cross-canadian' in pkg:
33 continue
34 for p in prefixes:
35 newpkg = p + "-" + pkg
36 if not e.data.getVarFlag('PNBLACKLIST', newpkg, True):
37 e.data.setVarFlag('PNBLACKLIST', newpkg, reason)
38}
39
40python () {
41 blacklist = d.getVarFlag('PNBLACKLIST', d.getVar('PN', True), True)
42
43 if blacklist:
44 raise bb.parse.SkipPackage("Recipe is blacklisted: %s" % (blacklist))
45}