BBFILES_DYNAMIC: add inverse mode
A message that is not in the archive (sent off-list or not yet received): [email protected]
Friendly reminder.
If the patch isn't applicable for some reason: I'd like to ask how I could 'emulate' the patch.
If I read the code correctly it isn't possible to do the same as part of the layer.conf, as the list is filled one layer.conf after another and so the existence of a layer name in BBFILE_COLLECTIONS is dependent on the order in BBLAYERS - which makes it prone to errors.
I currently have some recipes which are provided by some optional layer, but as they tend to provide/override more than needed (in this case just a single recipe) it would be nice to have that backfill possibility. So it's up to the user to choose if the full layer meets his needs or the backfill recipe is just enough.
Looking forward to some feedback.
Regards
Konrad
Quoted 30 lines · Konrad Weihmann
Add an inverse mode for
BBFILES_DYNAMIC.
Entries where the layername is prefix with '!' will act in inverted mode including given glob mask in absence of the referenced layer. This is useful to backfill recipes from potentially missing layer.Signed-off-by Konrad Weihmann <[email protected]>--- lib/bb/cookerdata.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)lib/bb/cookerdata.py +4
-1@@ -387,7 +387,10 @@ class CookerDataBuilder(object): invalid.append(entry) continue l, f = parts - if l in collections: + invert = l[0] == "!" + if invert: + l = l[1:] + if (l in collections and not invert) or (l not in collections and invert): data.appendVar("BBFILES", " " + f) if invalid: bb.fatal("BBFILES_DYNAMIC entries must be of the form <collection name>:<filename pattern>, not:\n %s" % "\n ".join(invalid))
Quoted 21 lines · Konrad Weihmann
Friendly reminder.
If the patch isn't applicable for some reason: I'd like to ask how I could 'emulate' the patch.If I read the code correctly it isn't possible to do the same as part of
the layer.conf, as the list is filled one layer.conf after another and
so the existence of a layer name inBBFILE_COLLECTIONSis dependent on
the order in BBLAYERS - which makes it prone to errors.I currently have some recipes which are provided by some optional layer,
but as they tend to provide/override more than needed (in this case just
a single recipe) it would be nice to have that backfill possibility. So it's up to the user to choose if the full layer meets his needs or
the backfill recipe is just enough.
Quoted 1 line
Looking forward to some feedback.
I wanted to give that patch some thought but it does make sense. Could you please update the patch or send a followup which updates the manual with the new syntax though please?
Cheers,
Richard