spawn_nofetch: clone locked config, bug #408817
authorZac Medico <zmedico@gentoo.org>
Mon, 19 Mar 2012 18:12:32 +0000 (11:12 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 19 Mar 2012 18:12:32 +0000 (11:12 -0700)
It's unsafe to pass in an unlocked config instance, since that can
trigger issues like bug #408817 due to fragile assumptions involving
the config state inside doebuild_environment().

pym/_emerge/resolver/output.py
pym/portage/package/ebuild/_spawn_nofetch.py
pym/portage/package/ebuild/digestgen.py

index 53ec4f02f9eff01307aa30a809fffd66e1c4b823..bec6619a16eb84036911e08d85916ab92fc6a893 100644 (file)
@@ -914,8 +914,7 @@ class Display(object):
                        writemsg_stdout("\nFetch instructions for %s:\n" % (pkg.cpv,),
                                                        noiselevel=-1)
                        spawn_nofetch(self.conf.trees[pkg.root]["porttree"].dbapi,
-                               pkg_info.ebuild_path,
-                               settings=self.conf.pkgsettings[pkg.root])
+                               pkg_info.ebuild_path)
                if self.conf.changelog:
                        self.print_changelog()
 
index bda1dc0786c900798255716ceb365dd7e3fc2e8d..94f8c79a31737b83ba969234441d1b853d7187df 100644 (file)
@@ -20,7 +20,11 @@ def spawn_nofetch(portdb, ebuild_path, settings=None):
        to cache metadata. It will be cloned internally, in order to
        prevent any changes from interfering with the calling code.
        If settings is None then a suitable config instance will be
-       acquired from the given portdbapi instance.
+       acquired from the given portdbapi instance. Do not use the
+       settings parameter unless setcpv has been called on the given
+       instance, since otherwise it's possible to trigger issues like
+       bug #408817 due to fragile assumptions involving the config
+       state inside doebuild_environment().
 
        A private PORTAGE_BUILDDIR will be created and cleaned up, in
        order to avoid any interference with any other processes.
index f14368d239320ca551816faec4a67eae392219b5..38e9991bd7f50cb225dea8c9de0a6b696976ec4f 100644 (file)
@@ -148,8 +148,7 @@ def digestgen(myarchives=None, mysettings=None, myportdb=None):
                                        if not fetch({myfile : uris}, mysettings):
                                                myebuild = os.path.join(mysettings["O"],
                                                        catsplit(cpv)[1] + ".ebuild")
-                                               spawn_nofetch(myportdb, myebuild,
-                                                       settings=mysettings)
+                                               spawn_nofetch(myportdb, myebuild)
                                                writemsg(_("!!! Fetch failed for %s, can't update "
                                                        "Manifest\n") % myfile, noiselevel=-1)
                                                if myfile in dist_hashes and \