Gentoo Archives: gentoo-portage-dev

From: Brian Dolbec <dolsen@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [Patch] Repoman rewrite stage2 modularization conversion complete
Date: Tue, 15 Mar 2016 00:48:10
Message-Id: 20160314174710.4b6ebd1e.dolsen@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [Patch] Repoman rewrite stage2 modularization conversion complete by Zac Medico
1 On Mon, 14 Mar 2016 17:18:27 -0700
2 Zac Medico <zmedico@g.o> wrote:
3
4 > On 03/14/2016 10:52 AM, Brian Dolbec wrote:
5 > > On Mon, 14 Mar 2016 10:22:11 -0700
6 > > Zac Medico <zmedico@g.o> wrote:
7 > >
8 > >> On 03/14/2016 10:14 AM, Zac Medico wrote:
9 > >>> On 03/05/2016 01:37 PM, Brian Dolbec wrote:
10 > >>>
11 > >>>> Zac, I'm done with code changes in the rewrite. Ready for a last
12 > >>>> look before a merge. Can you have a look again? I did some
13 > >>>> changes/fixes and rebased them in. Floppym hasn't reported any
14 > >>>> more bugs, so I think it's ready for broader testing in a
15 > >>>> release. Then we can work on moving all the test data to a
16 > >>>> separate file in the tree or downloaded...
17 > >>>
18 > >>> The dynamic_data stuff in Scanner is a little hard to follow. Then
19 > >>> it calls dynamic_data.update(rdata), is there any chance that the
20 > >>> update operation might clobber something that shouldn't have been
21 > >>> clobbered?
22 > >>
23 > >> To clarify my question, suppose that one function returns {'foo':
24 > >> True} and another one returns {'foo', False}, so now there first
25 > >> {'foo': True} setting is forgotten. Is that going to be a
26 > >> problem?
27 > >
28 > > No, as stated in my other reply. There are only a few things that
29 > > are modified. Mostly as I made a new module, following the original
30 > > order the checks were run. As data was discovered missing it was
31 > > added to dynamic_data from the previous check that supplied it to
32 > > the Scanner class. So, only data needed later was passed back to
33 > > update the dynamic_data.
34 > >
35 > > Also all those checks originally ran in one huge 1k LOC loop with
36 > > another slightly smaller ebuild loop nested inside it. So all those
37 > > variables were subject to change already by previous code run. In
38 > > the stage1 rewrite, I/we did the same thing in creating the
39 > > separated checks classes. After the check was done, only the data
40 > > required was brought back into the primary loop.
41 > >
42 >
43 > I've found what may be a real instance of the kind of problem I was
44 > worried about. The 'allvalid' key is set in both
45 > pym/repoman/modules/scan/ebuild/isebuild.py and
46 > pym/repoman/modules/scan/ebuild/ebuild.py, and its non-trivial for me
47 > to determine whether this is a real problem or not.
48
49 It is not a problem.
50
51 allvalid is initialized in the isEbuild class at the start of the pkg
52 level checks to True, then there are several things that if found reset
53 it to False...
54
55 Then when it gets to the ebuild level checks the ebuild check there
56 just sets it False if the pkg.invalid variable is True. In some cases
57 it might be a double False, but never will it trounce the previous
58 setting.
59
60 The only consumer for that allvalid variable is the metadata
61 UnusedCheck class.
62
63 So the allvalid variable is True until found False
64 by whichever checks along the way find it to be False. Like a fuse,
65 it's good until it's blown, then it can never be good again. I don't
66 think this particular variable justifies a special class that more
67 fully mimics a fuse. Impossible to reset it like a breaker.
68
69 To be honest I did not look into the pkg.invalid variable's need to be
70 setting it False in the Ebuild class. It may in fact be a dupe of a
71 setting in the isEbuild class or it might be moved there. That original
72 spaghetti code could in fact have had duplicates since it was so hard
73 to figure out where to embed something.
74 --
75 Brian Dolbec <dolsen>

Replies