Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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 |
| 16 | addhandler blacklist_multilib_eventhandler |
| 17 | blacklist_multilib_eventhandler[eventmask] = "bb.event.ConfigParsed" |
| 18 | python 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 | |
| 40 | python () { |
| 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 | } |