aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-25 20:39:01 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-25 20:54:36 +0000
commitcc200cc8be80e8309f0a00fe5a33acc7d93d5ddf (patch)
tree69731a0f68b29c030995a9155c65a75a0aff480f
parent553c4823a3221530ffd2430cb3e684273c0b1d86 (diff)
downloadpaludis-cc200cc8be80e8309f0a00fe5a33acc7d93d5ddf.tar.gz
paludis-cc200cc8be80e8309f0a00fe5a33acc7d93d5ddf.tar.xz
Fix binary ordering
-rw-r--r--paludis/resolver/nag.cc6
-rw-r--r--paludis/resolver/nag.hh1
-rw-r--r--paludis/resolver/orderer.cc10
3 files changed, 17 insertions, 0 deletions
diff --git a/paludis/resolver/nag.cc b/paludis/resolver/nag.cc
index 22db110..f4dffcd 100644
--- a/paludis/resolver/nag.cc
+++ b/paludis/resolver/nag.cc
@@ -418,6 +418,12 @@ NAG::end_nodes() const
return NodesConstIterator(_imp->nodes.end());
}
+NAG::NodesConstIterator
+NAG::find_node(const NAGIndex & x) const
+{
+ return NodesConstIterator(_imp->nodes.find(x));
+}
+
void
NAG::serialise(Serialiser & s) const
{
diff --git a/paludis/resolver/nag.hh b/paludis/resolver/nag.hh
index cc882bc..9dc0729 100644
--- a/paludis/resolver/nag.hh
+++ b/paludis/resolver/nag.hh
@@ -95,6 +95,7 @@ namespace paludis
typedef WrappedForwardIterator<NodesConstIteratorTag, const NAGIndex> NodesConstIterator;
NodesConstIterator begin_nodes() const PALUDIS_ATTRIBUTE((warn_unused_result));
NodesConstIterator end_nodes() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ NodesConstIterator find_node(const NAGIndex &) const PALUDIS_ATTRIBUTE((warn_unused_result));
void serialise(Serialiser &) const;
static const std::shared_ptr<NAG> deserialise(Deserialisation & d) PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index 6879807..48600c4 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -290,6 +290,16 @@ namespace
if (normal)
{
+ /* we might have added in binary creation later, so make from be
+ * our binary creation node rather than ourself, if applicable */
+ if (from.resolvent().destination_type() != dt_create_binary)
+ {
+ NAGIndex from_bin(from);
+ from_bin.resolvent().destination_type() = dt_create_binary;
+ if (nag->end_nodes() != nag->find_node(from_bin))
+ from = from_bin;
+ }
+
nag->add_edge(from, to,
make_named_values<NAGEdgeProperties>(
n::always() = false,