Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-portage-dev
Navigation:
Lists: gentoo-portage-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-portage-dev@g.o
From: Alec Warner <antarus@g.o>
Subject: Re: Config Cleanup Last Call
Date: Sat, 25 Feb 2006 10:35:52 -0500
Jason Stubbs wrote:
> On Saturday 25 February 2006 10:40, Alec Warner wrote:
> 
>>Please review for badness, otherwise I'll commit this soon ;)
> 
> 
>  - self.backupenv = os.environ.copy()
>  - self.configlist.append(self.backupenv) # XXX Why though?
>  - self.configdict["backupenv"]=self.configlist[-1]
>  + self.configdict["backupenv"]=os.environ.copy() # XXX Why though? ( ferringb? )
> 
> Kill this comment altogether. Reading it, my first thought is "why what?"
> It doesn't make the code clearer and so shouldn't be there.
killed
> 
>  - self.configlist.append(os.environ.copy())
>  - self.configdict["env"]=self.configlist[-1]
>  + ### backupenv maybe required to be a clone, and not just a reference
>  + ### the old code did value copy we do a reference here
>  + self.configdict["env"]=self.configdict["backupenv"]
Fixed to use a deepcopy instead of shallow
> 
> Again, this comment doesn't make the code clearer and so shouldn't be there.
> Changing functionality in a "cleanup" patch is also bad form. As for the
> change itself, it's broken. Look at __setitem__() and reset() and then look
> at the usage of those two throughout the code.
> 
>  - mydbs=self.configlist[:-1]
>  + #Abuse the order of lookuplist to emulate old behavior
>  + mydbs=self.lookuplist[:-1]
+ #abuse the order of lookuplist in order to have lookups done in the
correct order, "env" first.
> 
> Same deal with this comment. A person seeing the code for the first time has
> no idea what the old behaviour was. In the old code, configlist starts with
> "globals" and ends with "env". In the new (and old) code, lookuplist is the
> reverse of that. I don't see any further changes to account for this.
> 
In the old code configlist starts with env and ends with globals, but
the lookuplist is configlist.reverse()

<oldcode>
self.configdict = { "globals":   self.configlist[0],
                    "defaults":  self.configlist[1],
                    "conf":      self.configlist[2],
                    "pkg":       self.configlist[3],
                    "auto":      self.configlist[4],
                    "backupenv": self.configlist[5],
                    "env":       self.configlist[6] }

                        # make lookuplist for loading package.*
                        self.lookuplist=self.configlist[:]
                        self.lookuplist.reverse()
</oldcode>

> --
> Jason Stubbs
> 
Attachment:
signature.asc (OpenPGP digital signature)
Replies:
Questions regarding the new portage API (savior branch)
-- Michael Schilling
References:
Config Cleanup Last Call
-- Alec Warner
Re: Config Cleanup Last Call
-- Jason Stubbs
Navigation:
Lists: gentoo-portage-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Config Cleanup Last Call
Next by thread:
Questions regarding the new portage API (savior branch)
Previous by date:
Re: Config Cleanup Last Call
Next by date:
Questions regarding the new portage API (savior branch)


Updated Jun 17, 2009

Summary: Archive of the gentoo-portage-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.