spawn_nofetch: Ensure $A is defined.
authorZac Medico <zmedico@gentoo.org>
Mon, 17 Jan 2011 19:06:02 +0000 (11:06 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 17 Jan 2011 19:09:49 +0000 (11:09 -0800)
This will fix bug #351505.

pym/portage/package/ebuild/_spawn_nofetch.py

index 9ae80105072ea2132609a782c4930358070c91de..1678faf56b2c2ac905c331396f1de6f1d5b3d944 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import shutil
@@ -60,6 +60,12 @@ def spawn_nofetch(portdb, ebuild_path, settings=None):
        try:
                doebuild_environment(ebuild_path, 'nofetch',
                        settings=settings, db=portdb)
+               if "A" not in settings.configdict["pkg"]:
+                       mytree = os.path.dirname(os.path.dirname(
+                               os.path.dirname(ebuild_path)))
+                       fetch_map = portdb.getFetchMap(settings.mycpv,
+                               useflags=settings["PORTAGE_USE"].split(), mytree=mytree)
+                       settings.configdict["pkg"]["A"] = " ".join(fetch_map)
                restrict = settings['PORTAGE_RESTRICT'].split()
                defined_phases = settings['DEFINED_PHASES'].split()
                if not defined_phases: