[bitbake-devel] [PATCH WIP] bitbake-layers: Convert flatten to use collections.bbappends

Richard Purdie richard.purdie at linuxfoundation.org
Mon Mar 30 12:56:32 UTC 2015


flatten support currently looks broken since it doesn't appear to
deal with handling "%" support in bbappend file names.

This patch convert it to use collections.get_file_appends() which
correctly handles "%" support.

[FIXME: Also converts collections.appendlist -> collections.bbappends
but this code also appears to be missing "%" support?]

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

[Paul: I have to admit I'm struggling to understand what first_append does
so was struggling to further clean this up]

diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index 9824629..e30e0f6 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -622,31 +622,27 @@ build results (as the layer priority order has effectively changed).
                                     logger.warn('Overwriting file %s', fdest)
                             bb.utils.copyfile(f1full, fdest)
                             if ext == '.bb':
-                                if f1 in self.bbhandler.cooker.collection.appendlist:
-                                    appends = self.bbhandler.cooker.collection.appendlist[f1]
-                                    if appends:
-                                        logger.plain('  Applying appends to %s' % fdest )
-                                        for appendname in appends:
-                                            if layer_path_match(appendname):
-                                                self.apply_append(appendname, fdest)
+                                for append in self.bbhandler.cooker.collection.get_file_appends(f1full):
+                                    if layer_path_match(append):
+                                        logger.plain('  Applying append %s to %s' % (append, fdest))
+                                        self.apply_append(append, fdest)
                                     appended_recipes.append(f1)
 
         # Take care of when some layers are excluded and yet we have included bbappends for those recipes
-        for recipename in self.bbhandler.cooker.collection.appendlist.iterkeys():
+        for b in self.bbhandler.cooker.collection.bbappends:
+            (recipename, appendname) = b
             if recipename not in appended_recipes:
-                appends = self.bbhandler.cooker.collection.appendlist[recipename]
                 first_append = None
-                for appendname in appends:
-                    layer = layer_path_match(appendname)
-                    if layer:
-                        if first_append:
-                            self.apply_append(appendname, first_append)
-                        else:
-                            fdest = appendname[len(layer):]
-                            fdest = os.path.normpath(os.sep.join([outputdir,fdest]))
-                            bb.utils.mkdirhier(os.path.dirname(fdest))
-                            bb.utils.copyfile(appendname, fdest)
-                            first_append = fdest
+                layer = layer_path_match(appendname)
+                if layer:
+                    if first_append:
+                        self.apply_append(appendname, first_append)
+                    else:
+                        fdest = appendname[len(layer):]
+                        fdest = os.path.normpath(os.sep.join([outputdir,fdest]))
+                        bb.utils.mkdirhier(os.path.dirname(fdest))
+                        bb.utils.copyfile(appendname, fdest)
+                        first_append = fdest
 
         # Get the regex for the first layer in our list (which is where the conf/layer.conf file will
         # have come from)
@@ -722,7 +718,7 @@ build results (as the layer priority order has effectively changed).
 Lists recipes with the bbappends that apply to them as subitems.
 """
         self.init_bbhandler()
-        if not self.bbhandler.cooker.collection.appendlist:
+        if not self.bbhandler.cooker.collection.bbappends:
             logger.plain('No append files found')
             return 0
 





More information about the bitbake-devel mailing list