[oe-commits] [openembedded-core] 09/10: classes/packagegroup: Refactor code to be simpler

git at git.openembedded.org git at git.openembedded.org
Sat Apr 2 15:48:51 UTC 2016


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

commit f092f99a0d7116ba4347b22f3f81b4eac4808e62
Author: Ulf Magnusson <Ulf.Magnusson at bmw-carit.de>
AuthorDate: Fri Apr 1 10:53:31 2016 +0000

    classes/packagegroup: Refactor code to be simpler
    
    This makes the code a bit shorter and more readable.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/packagegroup.bbclass | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/meta/classes/packagegroup.bbclass b/meta/classes/packagegroup.bbclass
index d56248f..38bdbd3 100644
--- a/meta/classes/packagegroup.bbclass
+++ b/meta/classes/packagegroup.bbclass
@@ -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

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


More information about the Openembedded-commits mailing list