summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/depgraph.py12
-rw-r--r--pym/portage/tests/resolver/test_rebuild.py9
2 files changed, 15 insertions, 6 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 8a7686365..0de443b3d 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -267,15 +267,21 @@ class _rebuild_config(object):
# Remove our leaf node from the graph, keeping track of deps.
parents = graph.nodes[node][1].items()
graph.remove(node)
+ node_build_deps = build_deps.get(node, {})
+ node_runtime_deps = runtime_deps.get(node, {})
for parent, priorities in parents:
if parent == node:
# Ignore a direct cycle.
continue
+ parent_bdeps = build_deps.setdefault(parent, {})
+ parent_rdeps = runtime_deps.setdefault(parent, {})
for priority in priorities:
if priority.buildtime:
- build_deps.setdefault(parent, {})[slot_atom] = node
+ parent_bdeps[slot_atom] = node
if priority.runtime:
- runtime_deps.setdefault(parent, {})[slot_atom] = node
+ parent_rdeps[slot_atom] = node
+ if slot_atom in parent_bdeps and slot_atom in parent_rdeps:
+ parent_rdeps.update(node_runtime_deps)
if not graph.child_nodes(parent):
leaf_nodes.append(parent)
@@ -284,8 +290,6 @@ class _rebuild_config(object):
# completely filled in, and self.rebuild_list / self.reinstall_list
# will tell us whether any of our children need to be rebuilt or
# reinstalled.
- node_build_deps = build_deps.get(node, {})
- node_runtime_deps = runtime_deps.get(node, {})
if self._trigger_rebuild(node, node_build_deps, node_runtime_deps):
need_restart = True
diff --git a/pym/portage/tests/resolver/test_rebuild.py b/pym/portage/tests/resolver/test_rebuild.py
index 809dbed6c..fda289c6e 100644
--- a/pym/portage/tests/resolver/test_rebuild.py
+++ b/pym/portage/tests/resolver/test_rebuild.py
@@ -26,6 +26,8 @@ class RebuildTestCase(TestCase):
"sys-apps/d-2": { "RDEPEND" : "sys-libs/x"},
"sys-apps/e-2": { "DEPEND" : "sys-libs/x", "RDEPEND" : "sys-libs/x"},
"sys-apps/f-2": { "DEPEND" : "sys-apps/a", "RDEPEND" : "sys-apps/a"},
+ "sys-apps/g-2": { "DEPEND" : "sys-apps/b sys-libs/x",
+ "RDEPEND" : "sys-apps/b"},
}
installed = {
@@ -36,10 +38,12 @@ class RebuildTestCase(TestCase):
"sys-apps/d-1": { "RDEPEND" : "sys-libs/x"},
"sys-apps/e-1": { "DEPEND" : "sys-libs/x", "RDEPEND" : "sys-libs/x"},
"sys-apps/f-1": { "DEPEND" : "sys-apps/a", "RDEPEND" : "sys-apps/a"},
+ "sys-apps/g-1": { "DEPEND" : "sys-apps/b sys-libs/x",
+ "RDEPEND" : "sys-apps/b"},
}
world = ["sys-apps/a", "sys-apps/b", "sys-apps/c", "sys-apps/d",
- "sys-apps/e", "sys-apps/f"]
+ "sys-apps/e", "sys-apps/f", "sys-apps/g"]
test_cases = (
ResolverPlaygroundTestCase(
@@ -53,7 +57,8 @@ class RebuildTestCase(TestCase):
ResolverPlaygroundTestCase(
["sys-libs/x"],
options = {"--rebuild" : True},
- mergelist = ['sys-libs/x-2', 'sys-apps/a-2', 'sys-apps/b-2', 'sys-apps/e-2'],
+ mergelist = ['sys-libs/x-2', 'sys-apps/a-2', 'sys-apps/b-2',
+ 'sys-apps/e-2', 'sys-apps/g-2'],
ignore_mergelist_order = True,
success = True),
)