Gentoo Archives: gentoo-portage-dev

From: Alec Warner <antarus@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Re: Refactoring of emerge code
Date: Sun, 30 Apr 2006 19:42:39
Message-Id: 4455132E.2090709@gentoo.org
In Reply to: Re: [gentoo-portage-dev] Re: Refactoring of emerge code by m h
1 I'm more concerned with the revamp of Global vars in one commit, and
2 then the re-arrangement in the other.
3
4 m h wrote:
5 > Yes, I can break it up, but it will probably be 3 one line changes and
6 > one big 1000 line change. The 1000 line change is pretty
7 > straightforward. The only real code changes per se are removing any
8 > default logic (and placing it under the __main__ section). Let me see
9 > what I can do...
10 >
11 > I also messed around with pylint and pychecker today and they both
12 > caught some dead code (imports/parameters/variables not being used). I'd
13 > like to make this another patch as well.
14 >
15 > I noticed that this patch won't apply to the new portage (pre10 broke
16 > it). Should I be working against that or different code (from the cvs
17 > tree perhaps)? (I'd like to get a patch in that people can try before
18 > it becomes outdated).
19 >
20 > On 4/29/06, Alec Warner <antarus@g.o> wrote:
21 >
22 >> Is there any chance you can break this up? Mostly one patch for each *
23 >> below? OTherwise it's rather large ( 1000 lines ) and is difficult to
24 >> figure out what/when/where happened
25 >>
26 >> m h wrote:
27 >> > Upon further testing, I'm updating a line in the patch
28 >> >
29 >> > On 4/28/06, m h <sesquile@×××××.com> wrote:
30 >> >
31 >> >> Folks-
32 >> >>
33 >> >> I'm submitting a patch of a refactoring of the emerge code in
34 >> >> 2.1_pre9-r5. This patch adds no features per se. But I believe it
35 >> >> makes the code much more readable. This only addresses the
36 >> >> /usr/lib/portage/bin/emerge file.
37 >> >>
38 >> >> It does the following:
39 >> >>
40 >> >> * attempts to remove all global variables (with the exception of the
41 >> >> spinner animation)
42 >> >> * breaks up the heinous 900 lines of code at the bottom of the file
43 >> into:
44 >> >> * a __main__ section that calls out to
45 >> >> * do_SOMETHING where something is (depclean, search, info, config,
46 >> etc)
47 >> >> * removes any code that was dangling at the leftmost side of my editor
48 >> >> and puts it under the __main__ section
49 >> >> * removes an olddbapi variable that isn't used
50 >> >>
51 >> >> I've tested it with the sync, remove, search, update and it appears to
52 >> >> work. Any feedback is welcome.
53 >> >>
54 >> >> I hope that this gets in for a few reasons. I'm helping out with
55 >> >> doing some work on the PREFIX branch, having the code unstructured
56 >> >> makes it really hard to follow (hopefully it can get into trunk so I
57 >> >> don't need to patch prefix, everytime it's updated). One of my
58 >> >> coworkers just started adding some functionality to emerge (he'll send
59 >> >> his patches in soon), but this is really his first week using python,
60 >> >> and I don't want this to leave a bad taste in his mouth.... ;)
61 >> >>
62 >> >> -matt
63 >> >>
64 >> >>
65 >> >>
66 >> --
67 >> gentoo-portage-dev@g.o mailing list
68 >>
69 >>
70 >
71 --
72 gentoo-portage-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-portage-dev] Re: Refactoring of emerge code m h <sesquile@×××××.com>