summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/depgraph.py14
-rw-r--r--pym/portage/tests/resolver/test_merge_order.py10
2 files changed, 21 insertions, 3 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index caf150ac5..37fdeeda3 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1571,6 +1571,20 @@ class depgraph(object):
if not dep_priority.ignored or \
self._dynamic_config._traverse_ignored_deps:
+
+ inst_pkgs = [inst_pkg for inst_pkg in vardb.match_pkgs(virt_dep.atom)
+ if not reinstall_atoms.findAtomForPackage(inst_pkg,
+ modified_use=self._pkg_use_enabled(inst_pkg))]
+ if inst_pkgs:
+ for inst_pkg in inst_pkgs:
+ if self._pkg_visibility_check(inst_pkg):
+ # highest visible
+ virt_dep.priority.satisfied = inst_pkg
+ break
+ if not virt_dep.priority.satisfied:
+ # none visible, so use highest
+ virt_dep.priority.satisfied = inst_pkgs[0]
+
if not self._add_pkg(virt_pkg, virt_dep):
return 0
diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index 1b7cdddcd..ee3c7863a 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -127,18 +127,22 @@ class MergeOrderTestCase(TestCase):
},
"sys-libs/glibc-2.11" : {
"DEPEND" : "virtual/os-headers",
+ "RDEPEND": "",
},
"sys-libs/glibc-2.13" : {
"DEPEND" : "virtual/os-headers",
+ "RDEPEND": "",
},
"virtual/os-headers-0" : {
"RDEPEND" : "sys-kernel/linux-headers",
},
"sys-kernel/linux-headers-2.6.38": {
"DEPEND" : "app-arch/xz-utils",
+ "RDEPEND": "",
},
"sys-kernel/linux-headers-2.6.39": {
"DEPEND" : "app-arch/xz-utils",
+ "RDEPEND": "",
},
"app-arch/xz-utils-5.0.1" : {},
"app-arch/xz-utils-5.0.2" : {},
@@ -182,12 +186,14 @@ class MergeOrderTestCase(TestCase):
},
"sys-libs/glibc-2.11" : {
"DEPEND" : "virtual/os-headers",
+ "RDEPEND": "",
},
"virtual/os-headers-0" : {
"RDEPEND" : "sys-kernel/linux-headers",
},
"sys-kernel/linux-headers-2.6.38": {
"DEPEND" : "app-arch/xz-utils",
+ "RDEPEND": "",
},
"app-arch/xz-utils-5.0.1" : {},
}
@@ -321,14 +327,12 @@ class MergeOrderTestCase(TestCase):
# Test that OS_HEADERS_PACKAGE_ATOM and LIBC_PACKAGE_ATOM
# are merged asap, in order to account for implicit
# dependencies. See bug #303567.
- # TODO: optimize this to ensure that glibc comes before xz-utils
ResolverPlaygroundTestCase(
["app-arch/xz-utils", "sys-kernel/linux-headers", "sys-libs/glibc"],
options = {"--complete-graph" : True},
success = True,
all_permutations = True,
- ambiguous_merge_order = True,
- mergelist = ['sys-kernel/linux-headers-2.6.39', ('app-arch/xz-utils-5.0.2', 'sys-libs/glibc-2.13')]),
+ mergelist = ['sys-kernel/linux-headers-2.6.39', 'sys-libs/glibc-2.13', 'app-arch/xz-utils-5.0.2']),
)
playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)