Scheduler: set MERGE_TYPE for pkg_pretend
authorZac Medico <zmedico@gentoo.org>
Sat, 4 Dec 2010 19:45:49 +0000 (11:45 -0800)
committerZac Medico <zmedico@gentoo.org>
Sat, 4 Dec 2010 19:47:59 +0000 (11:47 -0800)
pym/_emerge/Scheduler.py

index 324e95517d460573067252be0b8df200be47f0a4..183a922f92024b904e3a11b21b1771ce48b558a8 100644 (file)
@@ -1025,6 +1025,7 @@ class Scheduler(PollScheduler):
                                os.makedirs(infloc)
                                portage.xpak.tbz2(tbz2_file).unpackinfo(infloc)
                                ebuild_path = os.path.join(infloc, x.pf + ".ebuild")
+                               settings.configdict["pkg"]["MERGE_TYPE"] = "binary"
 
                        else:
                                tree = "porttree"
@@ -1032,6 +1033,10 @@ class Scheduler(PollScheduler):
                                ebuild_path = portdb.findname(x.cpv)
                                if ebuild_path is None:
                                        raise AssertionError("ebuild not found for '%s'" % x.cpv)
+                               if self._build_opts.buildpkgonly:
+                                       settings.configdict["pkg"]["MERGE_TYPE"] = "buildonly"
+                               else:
+                                       settings.configdict["pkg"]["MERGE_TYPE"] = "source"
 
                        portage.package.ebuild.doebuild.doebuild_environment(ebuild_path,
                                "pretend", settings=settings,