[oe-commits] [openembedded-core] 14/20: image.bbclass: support duplicate compression types

git at git.openembedded.org git at git.openembedded.org
Sun May 22 07:52:27 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 6014a2ce34289672c84c94de02488265ee70eda6
Author: Patrick Ohly <patrick.ohly at intel.com>
AuthorDate: Wed May 18 19:24:14 2016 +0300

    image.bbclass: support duplicate compression types
    
    When a derived distro adds a certain type, say zip, to
    COMPRESSIONTYPES and later OE-core does the same, we end up with the
    type being listed twice, and that would have undesired effects
    (commands generated twice).
    
    So to support such loosely coupled extension, we de-duplicated the
    list of types first.
    
    Alternatively, such a situation could also be treated as error. But that
    seems unnecessary because typically commands for the same type will also
    do the same thing.
    
    Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
    Signed-off-by: Ed Bartosh <eduard.bartosh at intel.com>
    Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/image.bbclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 6b9f979..0e81b4e 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -297,7 +297,15 @@ python setup_debugfs () {
 
 python () {
     vardeps = set()
-    ctypes = d.getVar('COMPRESSIONTYPES', True).split()
+    # We allow COMPRESSIONTYPES to have duplicates. That avoids breaking
+    # derived distros when OE-core or some other layer independently adds
+    # the same type. There is still only one command for each type, but
+    # presumably the commands will do the same when the type is the same,
+    # even when added in different places.
+    #
+    # Without de-duplication, gen_conversion_cmds() below
+    # would create the same compression command multiple times.
+    ctypes = set(d.getVar('COMPRESSIONTYPES', True).split())
     old_overrides = d.getVar('OVERRIDES', 0)
 
     def _image_base_type(type):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list