Don't call varexpand inside getconfig for env.d/profile.env values.
authorZac Medico <zmedico@gentoo.org>
Fri, 6 Oct 2006 03:28:25 +0000 (03:28 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 6 Oct 2006 03:28:25 +0000 (03:28 -0000)
svn path=/main/trunk/; revision=4603

pym/portage.py
pym/portage_util.py

index 403caa7efb7f96f18bac49b1556b4eb5cdda4207..eafaf46d3339bbed07da9551f1973eb3ba5e7636 100644 (file)
@@ -570,7 +570,7 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None):
        for x in fns:
                file_path = os.path.join(envd_dir, x)
                try:
-                       myconfig = getconfig(file_path)
+                       myconfig = getconfig(file_path, expand=False)
                except portage_exception.ParseError, e:
                        writemsg("!!! '%s'\n" % str(e), noiselevel=-1)
                        del e
@@ -1127,7 +1127,7 @@ class config:
                        del blacklisted, cfg
 
                        env_d = getconfig(
-                               os.path.join(target_root, "etc", "profile.env"))
+                               os.path.join(target_root, "etc", "profile.env"), expand=False)
                        # env_d will be None if profile.env doesn't exist.
                        if env_d:
                                self.configdict["env.d"].update(env_d)
@@ -1530,7 +1530,7 @@ class config:
                # We grab the latest profile.env here since it changes frequently.
                self.configdict["env.d"].clear()
                env_d = getconfig(
-                       os.path.join(self["ROOT"], "etc", "profile.env"))
+                       os.path.join(self["ROOT"], "etc", "profile.env"), expand=False)
                if env_d:
                        # env_d will be None if profile.env doesn't exist.
                        self.configdict["env.d"].update(env_d)
index 52cbaa34c41b7637ec60b3e03857123a305467a2..f64169a9cc6d3670dc5b26673b5c2cd394322644 100644 (file)
@@ -226,7 +226,7 @@ def writedict(mydict,myfilename,writekey=True):
                return 0
        return 1
 
-def getconfig(mycfg,tolerant=0,allow_sourcing=False):
+def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True):
        mykeys={}
        try:
                f=open(mycfg,'r')
@@ -276,7 +276,10 @@ def getconfig(mycfg,tolerant=0,allow_sourcing=False):
                                        raise portage_exception.CorruptionError("ParseError: Unexpected EOF: "+str(mycfg)+": line "+str(lex.lineno))
                                else:
                                        return mykeys
-                       mykeys[key]=varexpand(val,mykeys)
+                       if expand:
+                               mykeys[key] = varexpand(val, mykeys)
+                       else:
+                               mykeys[key] = val
        except SystemExit, e:
                raise
        except Exception, e: