Gentoo Archives: gentoo-portage-dev

From: Brian Harring <ferringb@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [patch] emaint: check/fix package.{keywords,unmask}
Date: Thu, 16 Feb 2006 07:07:27
Message-Id: 20060216070645.GA11577@nightcrawler.had1.or.comcast.net
In Reply to: [gentoo-portage-dev] [patch] emaint: check/fix package.{keywords,unmask} by Christian Hoenig
1 On Tue, Feb 14, 2006 at 11:26:16AM +0100, Christian Hoenig wrote:
2 > Hi,
3 >
4 > attached is a patch for emaint contained in the sys-apps/portage-2.1_pre4-r1
5 > package that adds support for checking and fixing redundant entries in
6 > package.keywords and package.unmask.
7 >
8 > Fixing those files is done by commenting out corresponding lines (as suggested
9 > by Simon Stelling, thanks!)
10 >
11 > I added two handlers, one for package.keywords, one for package.unmask, as I
12 > like to check and fix them seperately. Though I don't think, that I shared
13 > their code pretty nice. I have experience in c++ but ...
14 >
15 > CODING DISCLAIMER
16 > ... I am pretty new to portage and python coding, so please forgive me my
17 > quirks and critizise me constructive :-).
18
19 Few things...
20 -(self.noneInstalled , self.noneAffected) = checkDict( cfg.punmaskdict )
21 +self.nonInstalled, self.noneAffected = checkDict(cfg.punmaskdict)
22 is a bit more normal
23
24 check should actually do the checks, rather then having
25 the work done during instantiation of the checker... potentially have
26 a base class those checkers inherit from instead of having the funcs
27 unbound (although this is definitely debatable).
28
29 Also...
30 errors = []
31 errors += map....
32
33 just do
34 errors = map...
35
36 map returns a list, no point instatiating an empty list then updating
37 it with another list :)
38
39 ~harring

Replies

Subject Author
Re: [gentoo-portage-dev] [patch] emaint: check/fix package.{keywords,unmask} Christian Hoenig <list@××××××.cc>