From 3205347f811c6fac9e84b66868c317b2ea376d8f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 13 Jul 2006 08:23:10 +0000 Subject: [PATCH] Split depgraph.merge() to a separate MergeTask class. svn path=/main/trunk/; revision=3844 --- bin/emerge | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/bin/emerge b/bin/emerge index 070279b7d..2b3c6325f 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1662,6 +1662,22 @@ class depgraph: def outdated(self): return self.outdatedpackages +class MergeTask(object): + + def __init__(self, settings, trees, myopts): + self.settings = settings + self.target_root = settings["ROOT"] + self.trees = trees + self.myopts = myopts + self.edebug = 0 + if settings.get("PORTAGE_DEBUG", "") == "1": + self.edebug = 1 + self.pkgsettings = {} + self.pkgsettings[self.target_root] = portage.config(clone=settings) + if self.target_root != "/": + self.pkgsettings["/"] = \ + portage.config(clone=trees["/"]["vartree"].settings) + def merge(self, mylist, favorites, mtimedb): returnme=0 mymergelist=[] @@ -3452,7 +3468,8 @@ def action_build(settings, trees, mtimedb, if ("--resume" in myopts): favorites=mtimedb["resume"]["favorites"] - mydepgraph.merge(mtimedb["resume"]["mergelist"], favorites, mtimedb) + mergetask = MergeTask(settings, trees, myopts) + mergetask.merge(mtimedb["resume"]["mergelist"], favorites, mtimedb) else: if "resume" in mtimedb and \ "mergelist" in mtimedb["resume"] and \ @@ -3483,7 +3500,8 @@ def action_build(settings, trees, mtimedb, pkglist.append(pkg) else: pkglist = mydepgraph.altlist() - mydepgraph.merge(pkglist, favorites, mtimedb) + mergetask = MergeTask(settings, trees, myopts) + mergetask.merge(pkglist, favorites, mtimedb) if mtimedb.has_key("resume"): del mtimedb["resume"] -- 2.26.2