]> code.ossystems Code Review - openembedded-core.git/commitdiff
package: ensure do_split_packages doesn't return duplicates
authorRoss Burton <ross.burton@intel.com>
Thu, 7 Apr 2016 08:54:56 +0000 (09:54 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 29 Jun 2016 18:33:21 +0000 (19:33 +0100)
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.

(From OE-Core rev: b251f8b212f16b16b88183cc9a959d8cfa24fe3c)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster@mvista.com>
meta/classes/package.bbclass

index 76b9f86491e7f42e3ca3c55b238955032c6a4c2a..ffd4eff7b1403deab895e5a09edf01878e682c4e 100644 (file)
@@ -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"