Gentoo Archives: gentoo-portage-dev

From: Alec Warner <antarus@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Config Cleanup Last Call
Date: Sat, 25 Feb 2006 15:10:18
Message-Id: 44007335.6020203@gentoo.org
In Reply to: Re: [gentoo-portage-dev] Config Cleanup Last Call by Jason Stubbs
1 Jason Stubbs wrote:
2 > On Saturday 25 February 2006 10:40, Alec Warner wrote:
3 >
4 >>Please review for badness, otherwise I'll commit this soon ;)
5 >
6 >
7 > - self.backupenv = os.environ.copy()
8 > - self.configlist.append(self.backupenv) # XXX Why though?
9 > - self.configdict["backupenv"]=self.configlist[-1]
10 > + self.configdict["backupenv"]=os.environ.copy() # XXX Why though? ( ferringb? )
11 >
12 > Kill this comment altogether. Reading it, my first thought is "why what?"
13 > It doesn't make the code clearer and so shouldn't be there.
14 >
15 > - self.configlist.append(os.environ.copy())
16 > - self.configdict["env"]=self.configlist[-1]
17 > + ### backupenv maybe required to be a clone, and not just a reference
18 > + ### the old code did value copy we do a reference here
19 > + self.configdict["env"]=self.configdict["backupenv"]
20 >
21 > Again, this comment doesn't make the code clearer and so shouldn't be there.
22 > Changing functionality in a "cleanup" patch is also bad form. As for the
23 > change itself, it's broken. Look at __setitem__() and reset() and then look
24 > at the usage of those two throughout the code.
25 >
26 > - mydbs=self.configlist[:-1]
27 > + #Abuse the order of lookuplist to emulate old behavior
28 > + mydbs=self.lookuplist[:-1]
29 >
30 > Same deal with this comment. A person seeing the code for the first time has
31 > no idea what the old behaviour was. In the old code, configlist starts with
32 > "globals" and ends with "env". In the new (and old) code, lookuplist is the
33 > reverse of that. I don't see any further changes to account for this.
34 >
35 > - if 0 and match and mykey in ["PORTAGE_BINHOST"]:
36 > - # These require HTTP Encoding
37 > ...
38 >
39 > This shouldn't be in a "cleanup" patch either.
40 >
41
42 Er, may I ask why it's in the code at all? :)
43
44 > --
45 > Jason Stubbs
46 >

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-portage-dev] Config Cleanup Last Call Jason Stubbs <jstubbs@g.o>