Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] ArchChecks: don't mix arches between ebuilds
Date: Sun, 24 Apr 2016 21:45:39
Message-Id: 571D3E7D.3070705@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] ArchChecks: don't mix arches between ebuilds by Brian Dolbec
1 On 04/24/2016 01:00 AM, Brian Dolbec wrote:
2 > On Sun, 24 Apr 2016 08:15:56 +0200
3 > Michał Górny <mgorny@g.o> wrote:
4 >
5 >> On Sat, 23 Apr 2016 16:57:21 -0700
6 >> Zac Medico <zmedico@g.o> wrote:
7 >>
8 >>> Fix ArchChecks to not mix arches of ebuilds together, so that
9 >>> errors are only reported for those arches that the ebuild has
10 >>> keywords for.
11 >>> ---
12 >>> Applies to the *repoman* branch.
13 >>>
14 >>> pym/repoman/modules/scan/arches/arches.py | 2 +-
15 >>> 1 file changed, 1 insertion(+), 1 deletion(-)
16 >>>
17 >>> diff --git a/pym/repoman/modules/scan/arches/arches.py
18 >>> b/pym/repoman/modules/scan/arches/arches.py index 4df25a8..6e1c17d
19 >>> 100644 --- a/pym/repoman/modules/scan/arches/arches.py
20 >>> +++ b/pym/repoman/modules/scan/arches/arches.py
21 >>> @@ -69,7 +69,7 @@ class ArchChecks(ScanBase):
22 >>> arches.add(('**', '**', ('**',)))
23 >>> # update the dynamic data
24 >>> dyn_arches = kwargs.get('arches')
25 >>> - #dyn_arches.clear()
26 >>> + dyn_arches.clear()
27 >>> dyn_arches.update(arches)
28 >>
29 >> Is that some crazy way of replacing contents of an existing dict? May
30 >> be worth a comment since the code looks suspicious, at least.
31 >>
32 >
33 > It was an interim step so that modules didn't pass back
34 > arbitrary data to be re-used by other modules after it. This way
35 > maintains the data pointer to the set (not dict) object in the calling
36 > function. Just assigning it a new set doesn't set the 'arches' pointer
37 > in the calling function so that it can pass that data along to other
38 > modules.
39
40 I feel like the plugin structure has lead to decoupling of things that
41 really should be coupled. For example, the code in the ArchChecks could
42 be a function that's called by the ProfileDependsChecks plugin, given
43 that ProfileDependsChecks seems to be the only consumer of this data.
44 --
45 Thanks,
46 Zac

Replies