Make the variable substitution code for bug #221755 slightly more efficient
authorZac Medico <zmedico@gentoo.org>
Sun, 11 May 2008 23:51:41 +0000 (23:51 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 11 May 2008 23:51:41 +0000 (23:51 -0000)
by allowing getconfig() to directly update the map that's used for
substitutions.

svn path=/main/trunk/; revision=10296

pym/portage/__init__.py
pym/portage/util.py

index 13462b97b30625f593461a7d21d829e8b221fba7..5cc66043b7b49c8f1e044d5a0519f77ecb45499a 100644 (file)
@@ -1286,7 +1286,6 @@ class config(object):
                                for x in self.profiles:
                                        var_map = getconfig(os.path.join(x, "make.defaults"),
                                                expand=expand_map)
-                                       expand_map.update(var_map)
                                        mygcfg_dlists.append(var_map)
 
                                for cfg in mygcfg_dlists:
index 17c066bc831864a1f05c7d5fba1793c1fd662abf..61ee3d88d375f140157e49b3f54bcc920873864c 100644 (file)
@@ -323,7 +323,7 @@ def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True):
        if isinstance(expand, dict):
                # Some existing variable definitions have been
                # passed in, for use in substitutions.
-               expand_map = expand.copy()
+               expand_map = expand
                expand = True
        else:
                expand_map = {}