aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2019-12-19 22:58:58 -0800
committerZac Medico <zmedico@gentoo.org>2019-12-23 14:23:15 -0800
commit85f0dd173ab75bcc39c3616b5a3a967bdc88cf73 (patch)
tree38dc3ef5b6a6678346a2635bedb4c08041695d6d /lib/_emerge/depgraph.py
parenttestVirtualCmakeBootstrapUseConditional: use RDEPEND for virtual/cmake (diff)
downloadportage-85f0dd173ab75bcc39c3616b5a3a967bdc88cf73.tar.gz
portage-85f0dd173ab75bcc39c3616b5a3a967bdc88cf73.tar.bz2
portage-85f0dd173ab75bcc39c3616b5a3a967bdc88cf73.zip
emerge --with-test-deps: allow circular deps
When USE=test is not enabled, allow circular test dependencies by treating them like PDEPEND. When USE=test is enabled, circular dependencies are still not allowed, as shown in unit tests. Suggested-by: Michał Górny <mgorny@gentoo.org> Bug: https://bugs.gentoo.org/703348 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge/depgraph.py')
-rw-r--r--lib/_emerge/depgraph.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 1a5448c8f..83631fe70 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -3325,10 +3325,6 @@ class depgraph(object):
pkg.iuse.is_valid_flag("test") and \
self._is_argument(pkg)
- if with_test_deps:
- use_enabled = set(use_enabled)
- use_enabled.add("test")
-
if not pkg.built and \
"--buildpkgonly" in self._frozen_config.myopts and \
"deep" not in self._dynamic_config.myparams:
@@ -3430,6 +3426,21 @@ class depgraph(object):
noiselevel=-1, level=logging.DEBUG)
try:
+ if (with_test_deps and 'test' not in use_enabled and
+ pkg.iuse.is_valid_flag('test')):
+ test_deps = portage.dep.use_reduce(dep_string,
+ uselist=use_enabled | {'test'},
+ is_valid_flag=pkg.iuse.is_valid_flag,
+ opconvert=True, token_class=Atom,
+ eapi=pkg.eapi,
+ subset={'test'})
+
+ if test_deps and not self._add_pkg_dep_string(
+ pkg, dep_root, self._priority(runtime_post=True),
+ test_deps,
+ allow_unsatisfied):
+ return 0
+
dep_string = portage.dep.use_reduce(dep_string,
uselist=use_enabled,
is_valid_flag=pkg.iuse.is_valid_flag,