skip_recipe_dynamic.bbclass 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Skip recipes for names which include variable references, handling multilibs.
  2. #
  3. # Ex.
  4. # SKIP_RECIPE_DYNAMIC += "${MLPREFIX}gcc-cross-${TARGET_ARCH}"
  5. # SKIP_RECIPE_DYNAMIC += "gcc-source-${@'${GCCVERSION}'.replace('%', '')}"
  6. SKIP_RECIPE_DYNAMIC ?= ""
  7. python skip_recipe_dynamic_setup () {
  8. d = e.data
  9. blacklisted = d.getVar('SKIP_RECIPE_DYNAMIC', False)
  10. if not blacklisted.strip():
  11. return
  12. multilibs = d.getVar('MULTILIBS', True) or ''
  13. # this block has been copied from base.bbclass so keep it in sync
  14. prefixes = []
  15. for ext in multilibs.split():
  16. eext = ext.split(':')
  17. if len(eext) > 1 and eext[0] == 'multilib':
  18. prefixes.append(eext[1])
  19. to_blacklist = set()
  20. for prefix in [''] + prefixes:
  21. localdata = bb.data.createCopy(d)
  22. if prefix:
  23. localdata.setVar('MLPREFIX', prefix + '-')
  24. override = ':virtclass-multilib-' + prefix
  25. localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override)
  26. bb.data.update_data(localdata)
  27. to_blacklist |= set(filter(None, localdata.getVar('SKIP_RECIPE_DYNAMIC').split()))
  28. for blrecipe in to_blacklist:
  29. d.setVarFlag('SKIP_RECIPE', blrecipe, 'skipped by SKIP_RECIPE_DYNAMIC')
  30. }
  31. skip_recipe_dynamic_setup[eventmask] = "bb.event.ConfigParsed"
  32. addhandler skip_recipe_dynamic_setup