summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-08-06 21:14:21 +0200
committerZac Medico <zmedico@gentoo.org>2010-08-06 14:53:57 -0700
commitb14a48bd91262033c8cdfdceb296dc6db6aaf266 (patch)
treed2d3db667eafe4cccdb08264551bf40b744ec8b5 /pym/portage/tests/resolver/ResolverPlayground.py
parentFix typo in comment. (diff)
downloadportage-multirepo-b14a48bd91262033c8cdfdceb296dc6db6aaf266.tar.gz
portage-multirepo-b14a48bd91262033c8cdfdceb296dc6db6aaf266.tar.bz2
portage-multirepo-b14a48bd91262033c8cdfdceb296dc6db6aaf266.zip
autounmask: Add ability to adjust USE
Diffstat (limited to 'pym/portage/tests/resolver/ResolverPlayground.py')
-rw-r--r--pym/portage/tests/resolver/ResolverPlayground.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index a9954fef..3740f831 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -14,6 +14,7 @@ from portage.package.ebuild.config import config
from portage.sets import load_default_config
from portage.versions import catsplit
+from _emerge.Blocker import Blocker
from _emerge.create_depgraph_params import create_depgraph_params
from _emerge.depgraph import backtrack_depgraph
from _emerge.RootConfig import RootConfig
@@ -183,19 +184,30 @@ class ResolverPlayground(object):
# Add a fake _test_ option that can be used for
# conditional test code.
myopts["_test_"] = True
-
+
portage.util.noiselimit = -2
myparams = create_depgraph_params(myopts, myaction)
success, mydepgraph, favorites = backtrack_depgraph(
self.settings, self.trees, myopts, myparams, myaction, myfiles, None)
+ result = ResolverPlaygroundResult(success, mydepgraph, favorites)
portage.util.noiselimit = 0
- if success:
- mergelist = [x.cpv for x in mydepgraph._dynamic_config._serialized_tasks_cache]
- return True, mergelist
- else:
- #TODO: Use mydepgraph.display_problems() to return a useful error message
- return False, None
+ return result
def cleanup(self):
shutil.rmtree(self.root)
+
+class ResolverPlaygroundResult(object):
+ def __init__(self, success, mydepgraph, favorites):
+ self.success = success
+ self.depgraph = mydepgraph
+ self.favorites = favorites
+ self.mergelist = None
+
+ if self.depgraph._dynamic_config._serialized_tasks_cache is not None:
+ self.mergelist = []
+ for x in self.depgraph._dynamic_config._serialized_tasks_cache:
+ if isinstance(x, Blocker):
+ self.mergelist.append(x.atom)
+ else:
+ self.mergelist.append(x.cpv)