diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-05 13:34:47 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-05 13:37:33 -0700 |
commit | 81821e3626dba0319c37527c823a99b5254b7847 (patch) | |
tree | b1c2e6484d098abcf4ec28e34db7bef4fb41b480 /pym | |
parent | Use a ResolverPlayground.cleanup() method to cleanup temporary directories. (diff) | |
download | portage-multirepo-81821e3626dba0319c37527c823a99b5254b7847.tar.gz portage-multirepo-81821e3626dba0319c37527c823a99b5254b7847.tar.bz2 portage-multirepo-81821e3626dba0319c37527c823a99b5254b7847.zip |
Add a fake _test_ option to myopts that can be used for conditional test code.
Diffstat (limited to 'pym')
-rw-r--r-- | pym/_emerge/depgraph.py | 6 | ||||
-rw-r--r-- | pym/portage/tests/resolver/ResolverPlayground.py | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 15004821..cc697ccf 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -66,10 +66,10 @@ class _frozen_depgraph_config(object): if settings.get("PORTAGE_DEBUG", "") == "1": self.edebug = 1 self.spinner = spinner - if "/" in trees: - self._running_root = trees["/"]["root_config"] - else: + if "_test_" in myopts and "/" not in trees: self._running_root = trees[self.target_root]["root_config"] + else: + self._running_root = trees["/"]["root_config"] self._opts_no_restart = frozenset(["--buildpkgonly", "--fetchonly", "--fetch-all-uri", "--pretend"]) self.pkgsettings = {} diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py index 9034deb8..a9954fef 100644 --- a/pym/portage/tests/resolver/ResolverPlayground.py +++ b/pym/portage/tests/resolver/ResolverPlayground.py @@ -180,6 +180,9 @@ class ResolverPlayground(object): myopts["--root"] = self.root myopts["--config-root"] = self.root myopts["--root-deps"] = "rdeps" + # 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) |