* [PATCH] package: ensure do_split_packages doesn't return duplicates
@ 2016-04-07 8:56 Ross Burton
2016-04-08 7:01 ` Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: Ross Burton @ 2016-04-07 8:56 UTC (permalink / raw)
To: openembedded-core
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@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 4452e2f..8cf9c16 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"
--
2.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] package: ensure do_split_packages doesn't return duplicates
2016-04-07 8:56 [PATCH] package: ensure do_split_packages doesn't return duplicates Ross Burton
@ 2016-04-08 7:01 ` Richard Purdie
2016-04-08 9:16 ` Burton, Ross
0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2016-04-08 7:01 UTC (permalink / raw)
To: Ross Burton, openembedded-core
On Thu, 2016-04-07 at 09:56 +0100, Ross Burton wrote:
> 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.
Is this order sensitive? I know PACKAGES is :(
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] package: ensure do_split_packages doesn't return duplicates
2016-04-08 7:01 ` Richard Purdie
@ 2016-04-08 9:16 ` Burton, Ross
0 siblings, 0 replies; 3+ messages in thread
From: Burton, Ross @ 2016-04-08 9:16 UTC (permalink / raw)
To: Richard Purdie; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 751 bytes --]
On 8 April 2016 at 08:01, Richard Purdie <richard.purdie@linuxfoundation.org
> wrote:
> On Thu, 2016-04-07 at 09:56 +0100, Ross Burton wrote:
> > 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.
>
> Is this order sensitive? I know PACKAGES is :(
>
The order of the output is based on the order that files are found on
disk. I'll review the users in oe-core to verify that nothing there has
expectations on the contents beyond a list of package names.
Ross
[-- Attachment #2: Type: text/html, Size: 1188 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-08 9:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07 8:56 [PATCH] package: ensure do_split_packages doesn't return duplicates Ross Burton
2016-04-08 7:01 ` Richard Purdie
2016-04-08 9:16 ` Burton, Ross
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.