Gentoo Archives: gentoo-portage-dev

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

Replies

Subject Author
Re: [gentoo-portage-dev] Re: Refactoring of emerge code Donnie Berkholz <spyderous@g.o>