Make digestgen() use spawn_nofetch() when necessary, since fetch()
authorZac Medico <zmedico@gentoo.org>
Sat, 11 Sep 2010 04:23:56 +0000 (21:23 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 11 Sep 2010 04:23:56 +0000 (21:23 -0700)
no longer does it.

pym/portage/package/ebuild/digestgen.py

index ac64467d9d00dbbae97ea31170797b975fc47646..d5cb2b829169e5353ee6f280e75b0ae0e6fd6372 100644 (file)
@@ -7,7 +7,7 @@ import errno
 
 import portage
 portage.proxy.lazyimport.lazyimport(globals(),
-       'portage.package.ebuild.doebuild:doebuild_environment',
+       'portage.package.ebuild._spawn_nofetch:spawn_nofetch',
 )
 
 from portage import os
@@ -18,7 +18,6 @@ from portage.exception import InvalidDependString, FileNotFound, \
 from portage.localization import _
 from portage.manifest import Manifest
 from portage.output import colorize
-from portage.package.ebuild.config import config
 from portage.package.ebuild.fetch import fetch
 from portage.util import writemsg, writemsg_stdout
 from portage.versions import catsplit
@@ -104,29 +103,23 @@ def digestgen(myarchives=None, mysettings=None, myportdb=None):
                if missing_files:
                                mytree = os.path.realpath(os.path.dirname(
                                        os.path.dirname(mysettings["O"])))
-                               fetch_settings = config(clone=mysettings)
-                               debug = mysettings.get("PORTAGE_DEBUG") == "1"
                                for myfile in missing_files:
                                        uris = set()
                                        for cpv in distfiles_map[myfile]:
-                                               myebuild = os.path.join(mysettings["O"],
-                                                       catsplit(cpv)[1] + ".ebuild")
-                                               # for RESTRICT=fetch, mirror, etc...
-                                               doebuild_environment(myebuild, "fetch",
-                                                       mysettings["ROOT"], fetch_settings,
-                                                       debug, 1, myportdb)
                                                uris.update(myportdb.getFetchMap(
                                                        cpv, mytree=mytree)[myfile])
 
-                                       fetch_settings["A"] = myfile # for use by pkg_nofetch()
-
                                        try:
                                                st = os.stat(os.path.join(
                                                        mysettings["DISTDIR"],myfile))
                                        except OSError:
                                                st = None
 
-                                       if not fetch({myfile : uris}, fetch_settings):
+                                       if not fetch({myfile : uris}, mysettings):
+                                               myebuild = os.path.join(mysettings["O"],
+                                                       catsplit(cpv)[1] + ".ebuild")
+                                               spawn_nofetch(myportdb, myebuild,
+                                                       settings=mysettings)
                                                writemsg(_("!!! Fetch failed for %s, can't update "
                                                        "Manifest\n") % myfile, noiselevel=-1)
                                                if myfile in dist_hashes and \