summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-28 05:24:13 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-28 05:24:13 +0000
commit6edc8e26b9b08108beb1415268167a787df3be3d (patch)
tree7c8a43b4a802642f7dd712c7bec5a3ec3d76d8d1
parentbd1b7032211288aa82ca427d31a27d37c8a43f7a (diff)
downloadportage-6edc8e26b9b08108beb1415268167a787df3be3d.tar.gz
portage-6edc8e26b9b08108beb1415268167a787df3be3d.tar.bz2
portage-6edc8e26b9b08108beb1415268167a787df3be3d.zip
Split out an EbuildMerge class.
svn path=/main/trunk/; revision=10829
-rw-r--r--pym/_emerge/__init__.py38
1 files changed, 30 insertions, 8 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 4d252526c..23de6ef01 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -1451,6 +1451,30 @@ class EbuildFetcher(Task):
mydbapi=portdb, tree="porttree")
return retval
+class EbuildMerge(Task):
+
+ __slots__ = ("find_blockers", "ldpath_mtimes",
+ "pkg", "pretend", "settings")
+
+ def _get_hash_key(self):
+ hash_key = getattr(self, "_hash_key", None)
+ if hash_key is None:
+ self._hash_key = ("EbuildMerge", self.pkg._get_hash_key())
+ return self._hash_key
+
+ def execute(self):
+ root_config = self.pkg.root_config
+ settings = self.settings
+ retval = portage.merge(settings["CATEGORY"],
+ settings["PF"], settings["D"],
+ os.path.join(settings["PORTAGE_BUILDDIR"],
+ "build-info"), root_config.root, settings,
+ myebuild=settings["EBUILD"],
+ mytree="porttree", mydbapi=root_config.trees["porttree"].dbapi,
+ vartree=vartree, prev_mtimes=self.ldpath_mtimes,
+ blockers=self.find_blockers)
+ return retval
+
class BinpkgFetcher(Task):
__slots__ = ("use_locks", "pkg", "pretend",
@@ -6460,14 +6484,12 @@ class MergeTask(object):
if retval != os.EX_OK:
raise self._pkg_failure(retval)
- retval = portage.merge(pkgsettings["CATEGORY"],
- pkgsettings["PF"], pkgsettings["D"],
- os.path.join(pkgsettings["PORTAGE_BUILDDIR"],
- "build-info"), myroot, pkgsettings,
- myebuild=pkgsettings["EBUILD"],
- mytree="porttree", mydbapi=portdb,
- vartree=vartree, prev_mtimes=ldpath_mtimes,
- blockers=self._find_blockers(pkg))
+ merge = EbuildMerge(
+ find_blockers=self._find_blockers(pkg),
+ ldpath_mtimes=ldpath_mtimes,
+ pkg=pkg, pretend=pretend, settings=pkgsettings)
+ retval = merge.execute()
+
if retval != os.EX_OK:
raise self._pkg_failure(retval)
finally: