-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
*bump*
Alec Warner wrote:
> config has two sets of environment + use stuff.
>
> one is called configlist, the other configdict. They are essentially
> copies of each other, and since for me dicts with named keys are easier,
> plus the old code was written crappily and is hard for me to follow,
> nuked that also.
>
> Also nuked config.backupenv, since it's in configdict anyway.
>
> Please test this, it works here, want to make sure there are no kinks,
> specifically with backupenv.
-
- --- portage.py2006-01-15 00:08:06.170717008 -0500
+++ - 2006-01-15 00:22:00.597106000 -0500
@@ -931,17 +931,8 @@
self.use_defs = copy.deepcopy(clone.use_defs)
self.usemask = copy.deepcopy(clone.usemask)
- - self.configlist = copy.deepcopy(clone.configlist)
- - self.configlist[-1] = os.environ.copy()
- - 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] }
+ self.configdict = copy.deepcopy(clone.configdict)
self.profiles = copy.deepcopy(clone.profiles)
- - self.backupenv = copy.deepcopy(clone.backupenv)
self.pusedict = copy.deepcopy(clone.pusedict)
self.categories = copy.deepcopy(clone.categories)
self.pkeywordsdict = copy.deepcopy(clone.pkeywordsdict)
@@ -980,11 +971,8 @@
}
self.usemask=[]
- - self.configlist=[]
- - self.backupenv={}
# back up our incremental variables:
self.configdict={}
- - # configlist will contain: [ globals, defaults, conf,
pkg, auto,
backupenv (incrementals), origenv ]
# The symlink might not exist or might not be a symlink.
try:
@@ -1043,8 +1031,7 @@
writemsg("!!! Incorrect multiline literals can
cause this. Do not
use them.\n")
writemsg("!!! Errors in this file should be
reported on
bugs.gentoo.org.\n")
sys.exit(1)
- - self.configlist.append(self.mygcfg)
- - self.configdict["globals"]=self.configlist[-1]
+ self.configdict["globals"] = self.mygcfg
self.mygcfg = {}
if self.profiles:
@@ -1062,8 +1049,7 @@
writemsg("!!! not then please report
this to bugs.gentoo.org and,
if possible, a dev\n")
writemsg("!!! on #gentoo
(irc.freenode.org)\n")
sys.exit(1)
- - self.configlist.append(self.mygcfg)
- - self.configdict["defaults"]=self.configlist[-1]
+ self.configdict["defaults"]=self.mygcfg
try:
# XXX: Should depend on root?
@@ -1078,28 +1064,32 @@
sys.exit(1)
- - self.configlist.append(self.mygcfg)
- - self.configdict["conf"]=self.configlist[-1]
+ self.configdict["conf"]=self.mygcfg
- - self.configlist.append({})
- - self.configdict["pkg"]=self.configlist[-1]
+ self.configdict["pkg"]={}
#auto-use:
- - self.configlist.append({})
- - self.configdict["auto"]=self.configlist[-1]
+ self.configdict["auto"]={}
#backup-env (for recording our calculated incremental
variables:)
- - 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? )
- - 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