All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cooker.py: allow dangling bbappends if explicitly whitelisted
@ 2017-05-22 10:50 Patrick Ohly
  2017-05-25 15:50 ` Christopher Larson
  2017-06-02 12:58 ` Richard Purdie
  0 siblings, 2 replies; 12+ messages in thread
From: Patrick Ohly @ 2017-05-22 10:50 UTC (permalink / raw)
  To: bitbake-devel

Having a .bbappend without corresponding .bb file triggers an error or
at least warning, depending on the global BB_DANGLINGAPPENDS_WARNONLY.

Some layers (for example, meta-freescale) avoid that message by only
adding .bbappends to the BBFILES when the layers they apply to are
present. Others (like intel-iot-refkit) avoid such .bbappends by
falling back to global assignments with _pn-<recipe> as override. Both
is complicated.

Now the warning code checks BBAPPENDS_DANGLING_WHITELIST and ignores
all bbappends which match a file pattern in that list. This is an
easier way to have bbappends which may or may not apply to an
existing recipe.

Example usage:

  # We have recipes-* directories, add to BBFILES
  BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
	${LAYERDIR}/optional-bbappends/recipes-*/*/*.bbappend \
	${LAYERDIR}/recipes-*/*/*.bbappend"

  # Several of our *.bbappends might be for layers that are not
  # guaranteed to be present. Don't warn or even error out because
  # of those.
  BBAPPENDS_DANGLING_WHITELIST += "${LAYERDIR}/optional-bbappends/recipes-*/*/*.bbappend"

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
---
 lib/bb/cooker.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index bc8574a..687fbfd 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -45,6 +45,7 @@ import pyinotify
 import json
 import pickle
 import codecs
+import fnmatch
 
 logger      = logging.getLogger("BitBake")
 collectlog  = logging.getLogger("BitBake.Collection")
@@ -1008,8 +1009,11 @@ class BBCooker:
             applied_appends.extend(self.collection.get_file_appends(fn))
 
         appends_without_recipes = []
+        appends_whitelist = (self.data.getVar("BBAPPENDS_DANGLING_WHITELIST") or "").split()
+        bb.note('Whitelist: %s' % appends_whitelist)
         for _, appendfn in self.collection.bbappends:
-            if not appendfn in applied_appends:
+            if not appendfn in applied_appends and \
+               not any(map(lambda whitelist_entry: fnmatch.fnmatch(appendfn, whitelist_entry), appends_whitelist)):
                 appends_without_recipes.append(appendfn)
 
         if appends_without_recipes:

base-commit: 362f6044fcaafe51ab4377af8f2606165b112717
-- 
git-series 0.9.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-06-07  9:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 10:50 [PATCH] cooker.py: allow dangling bbappends if explicitly whitelisted Patrick Ohly
2017-05-25 15:50 ` Christopher Larson
2017-05-25 20:01   ` Patrick Ohly
2017-05-26 13:56     ` Patrick Ohly
2017-05-30 19:54   ` Mark Hatle
2017-06-02 12:58 ` Richard Purdie
2017-06-02 13:06   ` Patrick Ohly
2017-06-02 13:26   ` Mark Hatle
2017-06-02 13:42     ` Christopher Larson
2017-06-02 16:14   ` Patrick Ohly
2017-06-02 16:20     ` Mark Hatle
2017-06-07  9:03   ` [PATCH] cookerdata: Add support for BBFILES_DYNAMIC Patrick Ohly

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.