]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/packagegroup: Refactor code to be simpler
authorUlf Magnusson <Ulf.Magnusson@bmw-carit.de>
Fri, 1 Apr 2016 10:53:31 +0000 (10:53 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 1 Apr 2016 14:09:10 +0000 (15:09 +0100)
This makes the code a bit shorter and more readable.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/packagegroup.bbclass

index d56248f2de199361df6f41dfe26c30a9040e4955..38bdbd382217271ed5b5fba11bb0110872858524 100644 (file)
@@ -22,19 +22,15 @@ inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED', True) == 'all', 'al
 # Also mark all packages as ALLOW_EMPTY
 python () {
     packages = d.getVar('PACKAGES', True).split()
-    for pkg in packages:
-        d.setVar("ALLOW_EMPTY_%s" % pkg, "1")
     if d.getVar('PACKAGEGROUP_DISABLE_COMPLEMENTARY', True) != '1':
-        # Add complementary packagegroups
-        genpackages = []
-        complementary_types = ['-dbg', '-dev']
+        types = ['', '-dbg', '-dev']
         if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
-            complementary_types.append('-ptest')
-        for pkg in packages:
-            for postfix in complementary_types:
-                genpackages.append(pkg+postfix)
-                d.setVar("ALLOW_EMPTY_%s" % pkg+postfix, "1")
-        d.setVar('PACKAGES', ' '.join(packages+genpackages))
+            types.append('-ptest')
+        packages = [pkg + suffix for pkg in packages
+                    for suffix in types]
+        d.setVar('PACKAGES', ' '.join(packages))
+    for pkg in packages:
+        d.setVar('ALLOW_EMPTY_%s' % pkg, '1')
 }
 
 # We don't want to look at shared library dependencies for the