[oe-commits] [openembedded-core] 06/31: package: ensure do_split_packages doesn't return duplicates

git at git.openembedded.org git at git.openembedded.org
Fri Apr 29 06:55:15 UTC 2016


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

commit b251f8b212f16b16b88183cc9a959d8cfa24fe3c
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Thu Apr 7 09:54:56 2016 +0100

    package: ensure do_split_packages doesn't return duplicates
    
    do_split_package() constructs a list of packages that were created as it
    iterates through the files, so if multiple files go into the same package then
    the package will be repeated in the output.
    
    Solve this by using a set() to store the created packages so that duplicates are
    ignored.
    
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/package.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 76b9f86..ffd4eff 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -146,7 +146,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
 
 
     packages = d.getVar('PACKAGES', True).split()
-    split_packages = []
+    split_packages = set()
 
     if postinst:
         postinst = '#!/bin/sh\n' + postinst + '\n'
@@ -183,7 +183,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
             continue
         on = legitimize_package_name(m.group(1))
         pkg = output_pattern % on
-        split_packages.append(pkg)
+        split_packages.add(pkg)
         if not pkg in packages:
             if prepend:
                 packages = [pkg] + packages
@@ -226,7 +226,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
             hook(f, pkg, file_regex, output_pattern, m.group(1))
 
     d.setVar('PACKAGES', ' '.join(packages))
-    return split_packages
+    return list(split_packages)
 
 PACKAGE_DEPENDS += "file-native"
 

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


More information about the Openembedded-commits mailing list