Fix EbuildFetcher to pass all config variables to the fetcher so things
authorZac Medico <zmedico@gentoo.org>
Sun, 27 Jul 2008 14:23:34 +0000 (14:23 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 27 Jul 2008 14:23:34 +0000 (14:23 -0000)
like http_proxy are included.

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

pym/_emerge/__init__.py
pym/portage/__init__.py

index a7d0c5c67246c415ea60b2c9f48f399ac5acd847..877d64179a57b600d12ce4bc041c2b9fb5a9973e 100644 (file)
@@ -2217,8 +2217,6 @@ class EbuildFetcher(SpawnProcess):
 
        __slots__ = ("fetchonly", "pkg",)
 
-       _env_vars = ("FETCHCOMMAND", "GENTOO_MIRRORS", "RESUMECOMMAND")
-
        def _start(self):
 
                root_config = self.pkg.root_config
@@ -2226,12 +2224,8 @@ class EbuildFetcher(SpawnProcess):
                ebuild_path = portdb.findname(self.pkg.cpv)
                settings = root_config.settings
 
-               fetch_env = settings.environ()
+               fetch_env = dict(settings.iteritems())
                fetch_env["PORTAGE_NICENESS"] = "0"
-               for k in self._env_vars:
-                       v = settings.get(k)
-                       if v is not None:
-                               fetch_env[k] = v
                if self.fetchonly:
                        fetch_env["PORTAGE_PARALLEL_FETCHONLY"] = "1"
 
index e4fe13eede18401825a22ff7ecd26d55f6e45c13..f17b8e8a6038772a3dcf1184c516215325f232c0 100644 (file)
@@ -2798,6 +2798,13 @@ class config(object):
        def iterkeys(self):
                return iter(self)
 
+       def iteritems(self):
+               for k in self:
+                       yield (k, self[k])
+
+       def items(self):
+               return list(self.iteritems())
+
        def __setitem__(self,mykey,myvalue):
                "set a value; will be thrown away at reset() time"
                if not isinstance(myvalue, str):