Gentoo Archives: gentoo-portage-dev

From: Douglas Anderson <dja@××××××.com>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] equery: RFC and code review
Date: Tue, 10 Feb 2009 10:54:00
Message-Id: efeb8d230902100253j47e85c7dr8faa9a519d9d0268@mail.gmail.com
1 Hi all,
2
3 It's been a few months since we first discussed refactoring equery on
4 this list and I think made pretty good time and I'm reasonably happy
5 with it. So I'm throwing out to you all. I've tried to keep a running
6 list of visible changes as I went along, but I'm sure I've missed some
7 things. You can read that here:
8
9 http://code.google.com/p/genscripts/source/browse/equery/trunk/equery/CHANGELOG
10
11 My primary goals for the refactorization were:
12 * Modularize
13 * Clean up the UI
14 * Rewrite a more solid option handler
15 * Eliminate as much duplicated code as possible
16 * Clean up slop and bitrot, follow clean coding standards and style
17 guidelines wherever possible
18 * Break up large functions, write docstrings for all functions
19 * Get code set for Python 2.6 (tested in 2.5 and 2.6) and prepare
20 smooth upgrade for Py3k.
21 * Create a more consistent experience for the user.
22
23 This last point is surely where the most contention will stem from, so
24 let me argue my position. All modules except for list, check and size
25 display the help message when called without input (ex: equery uses).
26 This makes sense. It's what most other programs do. It's what emerge
27 does. It's what eselect does. It's the neighborly thing to do.
28
29 However these three exceptions go and start a time-consuming process
30 which is of very limited usefulness. With a cold cache, each process
31 takes at least 30 seconds. I imagine that 99 percent of people who
32 type 'equery list' do it by accident. And who needs to see the size of
33 every installed package? And checksum every installed package? Almost
34 useless except to a select few people who know what they're doing.
35
36 So I took the liberty of changing the default behavior of these three
37 modules to be more in line with the rest of equery and the world. Each
38 of the three displays deprecation warning explaining how to recreate
39 the old default behavior. I can't imagine anyone objecting outright to
40 this, considering there will always be more than one version of
41 gentoolkit in the tree (there are 6 now) so it'd be a long time before
42 anyone was forced into the new behavior.
43
44 That's it. For anyone interested, please read the link above and let
45 me know if you like it/hate it/want something else done.
46
47 For python programmers, I'd appreciate a quick code review and any
48 comments/criticism whatsoever (I really like criticism).
49
50 Thanks in advance,
51 -Doug

Replies

Subject Author
Re: [gentoo-portage-dev] equery: RFC and code review Alec Warner <antarus@g.o>