summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-07-13 08:23:10 +0000
committerZac Medico <zmedico@gentoo.org>2006-07-13 08:23:10 +0000
commit3205347f811c6fac9e84b66868c317b2ea376d8f (patch)
tree736691bb490d234bb43fe22cfccdb9b1def4607f
parentb0f8b86d81642a17a4858d815e1dff5cf7559643 (diff)
downloadportage-3205347f811c6fac9e84b66868c317b2ea376d8f.tar.gz
portage-3205347f811c6fac9e84b66868c317b2ea376d8f.tar.bz2
portage-3205347f811c6fac9e84b66868c317b2ea376d8f.zip
Split depgraph.merge() to a separate MergeTask class.
svn path=/main/trunk/; revision=3844
-rwxr-xr-xbin/emerge22
1 files 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"]