summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-04-07 09:54:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-29 19:35:54 +0100
commit2fcce54c839451de96bc1105df5fd2de7dd879b1 (patch)
treecf0f34eb8152eb96ecd6495f22c5409fe88df9d1 /meta/classes
parent1b769a0774db469117bd8b00a7cdf9c9d2fe8bf4 (diff)
downloadpoky-2fcce54c839451de96bc1105df5fd2de7dd879b1.tar.gz
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. (From OE-Core rev: b251f8b212f16b16b88183cc9a959d8cfa24fe3c) (From OE-Core rev: 1aff01ddea6db059322939af0284dac370901546) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/package.bbclass6
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 76b9f86491..ffd4eff7b1 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
146 146
147 147
148 packages = d.getVar('PACKAGES', True).split() 148 packages = d.getVar('PACKAGES', True).split()
149 split_packages = [] 149 split_packages = set()
150 150
151 if postinst: 151 if postinst:
152 postinst = '#!/bin/sh\n' + postinst + '\n' 152 postinst = '#!/bin/sh\n' + postinst + '\n'
@@ -183,7 +183,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
183 continue 183 continue
184 on = legitimize_package_name(m.group(1)) 184 on = legitimize_package_name(m.group(1))
185 pkg = output_pattern % on 185 pkg = output_pattern % on
186 split_packages.append(pkg) 186 split_packages.add(pkg)
187 if not pkg in packages: 187 if not pkg in packages:
188 if prepend: 188 if prepend:
189 packages = [pkg] + packages 189 packages = [pkg] + packages
@@ -226,7 +226,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
226 hook(f, pkg, file_regex, output_pattern, m.group(1)) 226 hook(f, pkg, file_regex, output_pattern, m.group(1))
227 227
228 d.setVar('PACKAGES', ' '.join(packages)) 228 d.setVar('PACKAGES', ' '.join(packages))
229 return split_packages 229 return list(split_packages)
230 230
231PACKAGE_DEPENDS += "file-native" 231PACKAGE_DEPENDS += "file-native"
232 232