aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-22 14:18:12 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-22 23:34:00 +0100
commitd6f34ad6f149062c9c43e8647b03ef762323a4f2 (patch)
tree8b5aae22c45e7dd05b648f688c83827e54c7d881
parentcd9f4e058252beb02b924867946cb2ce1365177f (diff)
downloadpaludis-d6f34ad6f149062c9c43e8647b03ef762323a4f2.tar.gz
paludis-d6f34ad6f149062c9c43e8647b03ef762323a4f2.tar.xz
QPN:S -> Resolvent
-rw-r--r--paludis/resolver/Makefile.am8
-rw-r--r--paludis/resolver/arrow.cc6
-rw-r--r--paludis/resolver/arrow.hh6
-rw-r--r--paludis/resolver/decision.cc3
-rw-r--r--paludis/resolver/decision.hh3
-rw-r--r--paludis/resolver/destination-fwd.hh (renamed from paludis/resolver/destinations-fwd.hh)7
-rw-r--r--paludis/resolver/destination.cc (renamed from paludis/resolver/destinations.cc)90
-rw-r--r--paludis/resolver/destination.hh (renamed from paludis/resolver/destinations.hh)37
-rw-r--r--paludis/resolver/destination_types-fwd.hh3
-rw-r--r--paludis/resolver/qpn_s.cc182
-rw-r--r--paludis/resolver/qpn_s.hh75
-rw-r--r--paludis/resolver/reason.cc18
-rw-r--r--paludis/resolver/reason.hh4
-rw-r--r--paludis/resolver/resolution.cc7
-rw-r--r--paludis/resolver/resolution.hh9
-rw-r--r--paludis/resolver/resolvent-fwd.hh (renamed from paludis/resolver/qpn_s-fwd.hh)18
-rw-r--r--paludis/resolver/resolvent.cc167
-rw-r--r--paludis/resolver/resolvent.hh60
-rw-r--r--paludis/resolver/resolver.cc362
-rw-r--r--paludis/resolver/resolver.hh98
-rw-r--r--paludis/resolver/resolver_TEST_blockers.cc2
-rw-r--r--paludis/resolver/resolver_TEST_serialisation.cc2
-rw-r--r--paludis/resolver/resolver_TEST_suggestions.cc2
-rw-r--r--paludis/resolver/resolver_TEST_virtuals.cc2
-rw-r--r--paludis/resolver/resolver_functions.hh18
-rw-r--r--paludis/resolver/resolver_test.cc36
-rw-r--r--paludis/resolver/resolver_test.hh14
-rw-r--r--paludis/resolver/sanitised_dependencies.cc38
-rw-r--r--paludis/resolver/sanitised_dependencies.hh3
-rw-r--r--paludis/resolver/suggest_restart.cc19
-rw-r--r--paludis/resolver/suggest_restart.hh6
-rw-r--r--src/clients/cave/cmd_display_resolution.cc149
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc12
-rw-r--r--src/clients/cave/cmd_resolve.cc64
-rw-r--r--src/clients/cave/cmd_resolve_dump.cc69
35 files changed, 766 insertions, 833 deletions
diff --git a/paludis/resolver/Makefile.am b/paludis/resolver/Makefile.am
index 225c027..7a734d5 100644
--- a/paludis/resolver/Makefile.am
+++ b/paludis/resolver/Makefile.am
@@ -19,12 +19,12 @@ noinst_HEADERS = \
arrow.hh arrow-fwd.hh \
constraint.hh constraint-fwd.hh \
decision.hh decision-fwd.hh decision-se.hh \
+ destination.hh destination-fwd.hh \
destination_types.hh destination_types-fwd.hh destination_types-se.hh \
- destinations.hh destinations-fwd.hh \
- qpn_s.hh qpn_s-fwd.hh \
reason.hh reason-fwd.hh \
resolution.hh resolution-fwd.hh \
resolutions.hh resolutions-fwd.hh \
+ resolvent.hh resolvent-fwd.hh \
resolver.hh resolver-fwd.hh \
resolver_functions.hh resolver_functions-fwd.hh \
sanitised_dependencies.hh sanitised_dependencies-fwd.hh \
@@ -36,12 +36,12 @@ libpaludisresolver_a_SOURCES = \
arrow.cc \
constraint.cc \
decision.cc \
+ destination.cc \
destination_types.cc \
- destinations.cc \
- qpn_s.cc \
reason.cc \
resolution.cc \
resolutions.cc \
+ resolvent.cc \
resolver.cc \
sanitised_dependencies.cc \
serialise.cc \
diff --git a/paludis/resolver/arrow.cc b/paludis/resolver/arrow.cc
index 56c36c6..f4d31f3 100644
--- a/paludis/resolver/arrow.cc
+++ b/paludis/resolver/arrow.cc
@@ -30,8 +30,8 @@ void
Arrow::serialise(Serialiser & s) const
{
s.object("Arrow")
+ .member(SerialiserFlags<>(), "comes_after", comes_after())
.member(SerialiserFlags<>(), "ignorable_pass", ignorable_pass())
- .member(SerialiserFlags<>(), "to_qpn_s", to_qpn_s())
;
}
@@ -40,8 +40,8 @@ Arrow::deserialise(Deserialisation & d)
{
Deserialisator v(d, "Arrow");
return make_shared_ptr(new Arrow(make_named_values<Arrow>(
- value_for<n::ignorable_pass>(v.member<bool>("ignorable_pass")),
- value_for<n::to_qpn_s>(v.member<QPN_S>("to_qpn_s"))
+ value_for<n::comes_after>(v.member<Resolvent>("comes_after")),
+ value_for<n::ignorable_pass>(v.member<bool>("ignorable_pass"))
)));
}
diff --git a/paludis/resolver/arrow.hh b/paludis/resolver/arrow.hh
index bbdb930..98562b4 100644
--- a/paludis/resolver/arrow.hh
+++ b/paludis/resolver/arrow.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_RESOLVER_ARROW_HH 1
#include <paludis/resolver/arrow-fwd.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/serialise-fwd.hh>
#include <paludis/util/named_value.hh>
@@ -29,16 +29,16 @@ namespace paludis
{
namespace n
{
+ struct comes_after;
struct ignorable_pass;
- struct to_qpn_s;
}
namespace resolver
{
struct Arrow
{
+ NamedValue<n::comes_after, Resolvent> comes_after;
NamedValue<n::ignorable_pass, int> ignorable_pass;
- NamedValue<n::to_qpn_s, QPN_S> to_qpn_s;
void serialise(Serialiser &) const;
diff --git a/paludis/resolver/decision.cc b/paludis/resolver/decision.cc
index bec3297..57181ac 100644
--- a/paludis/resolver/decision.cc
+++ b/paludis/resolver/decision.cc
@@ -19,6 +19,7 @@
#include <paludis/resolver/decision.hh>
#include <paludis/resolver/serialise-impl.hh>
+#include <paludis/resolver/destination.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/stringify.hh>
#include <sstream>
@@ -32,6 +33,7 @@ void
Decision::serialise(Serialiser & s) const
{
s.object("Decision")
+ .member(SerialiserFlags<serialise::might_be_null>(), "destination", destination())
.member(SerialiserFlags<serialise::might_be_null>(), "if_package_id", if_package_id())
.member(SerialiserFlags<>(), "is_best", is_best())
.member(SerialiserFlags<>(), "is_same", is_same())
@@ -47,6 +49,7 @@ Decision::deserialise(Deserialisation & d)
{
Deserialisator v(d, "Decision");
return make_shared_ptr(new Decision(make_named_values<Decision>(
+ value_for<n::destination>(v.member<std::tr1::shared_ptr<Destination> >("destination")),
value_for<n::if_package_id>(v.member<std::tr1::shared_ptr<const PackageID> >("if_package_id")),
value_for<n::is_best>(v.member<bool>("is_best")),
value_for<n::is_same>(v.member<bool>("is_same")),
diff --git a/paludis/resolver/decision.hh b/paludis/resolver/decision.hh
index a7687be..c8c395d 100644
--- a/paludis/resolver/decision.hh
+++ b/paludis/resolver/decision.hh
@@ -22,6 +22,7 @@
#include <paludis/resolver/decision-fwd.hh>
#include <paludis/resolver/serialise-fwd.hh>
+#include <paludis/resolver/destination-fwd.hh>
#include <paludis/util/named_value.hh>
#include <paludis/package_id.hh>
@@ -29,6 +30,7 @@ namespace paludis
{
namespace n
{
+ struct destination;
struct if_package_id;
struct is_best;
struct is_same;
@@ -42,6 +44,7 @@ namespace paludis
{
struct Decision
{
+ NamedValue<n::destination, std::tr1::shared_ptr<Destination> > destination;
NamedValue<n::if_package_id, std::tr1::shared_ptr<const PackageID> > if_package_id;
NamedValue<n::is_best, bool> is_best;
NamedValue<n::is_same, bool> is_same;
diff --git a/paludis/resolver/destinations-fwd.hh b/paludis/resolver/destination-fwd.hh
index 5c472f9..d843e76 100644
--- a/paludis/resolver/destinations-fwd.hh
+++ b/paludis/resolver/destination-fwd.hh
@@ -17,17 +17,14 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_DESTINATIONS_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_DESTINATIONS_FWD_HH 1
-
-#include <paludis/util/attributes.hh>
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_DESTINATION_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_DESTINATION_FWD_HH 1
namespace paludis
{
namespace resolver
{
struct Destination;
- struct Destinations;
}
}
diff --git a/paludis/resolver/destinations.cc b/paludis/resolver/destination.cc
index a9f1cca..5aa0254 100644
--- a/paludis/resolver/destinations.cc
+++ b/paludis/resolver/destination.cc
@@ -17,102 +17,40 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/resolver/destinations.hh>
+#include <paludis/resolver/destination.hh>
#include <paludis/resolver/serialise-impl.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/join.hh>
+#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/enum_iterator.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/package_id.hh>
-#include <ostream>
-#include <sstream>
-#include <vector>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
using namespace paludis;
using namespace paludis::resolver;
-namespace paludis
-{
- template <>
- struct Implementation<Destinations>
- {
- std::vector<std::tr1::shared_ptr<const Destination> > destinations;
-
- Implementation() :
- destinations(static_cast<int>(last_dt), make_null_shared_ptr())
- {
- }
- };
-}
-
-Destinations::Destinations() :
- PrivateImplementationPattern<Destinations>(new Implementation<Destinations>)
-{
-}
-
-Destinations::~Destinations()
-{
-}
-
-const std::tr1::shared_ptr<const Destination>
-Destinations::by_type(const DestinationType t) const
-{
- return _imp->destinations.at(static_cast<int>(t));
-}
-
-void
-Destinations::set_destination_type(const DestinationType t, const std::tr1::shared_ptr<const Destination> & d)
-{
- _imp->destinations.at(t) = d;
-}
-
-void
-Destinations::serialise(Serialiser & s) const
-{
- SerialiserObjectWriter w(s.object("Destinations"));
- for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
- w.member(SerialiserFlags<serialise::might_be_null>(), stringify(*t), by_type(*t));
-}
-
-void
-Destination::serialise(Serialiser & s) const
-{
- s.object("Destination")
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(), "replacing", replacing())
- .member(SerialiserFlags<>(), "repository", stringify(repository()))
- ;
-}
-
-const std::tr1::shared_ptr<Destinations>
-Destinations::deserialise(Deserialisation & d)
-{
- const std::tr1::shared_ptr<Destinations> result(new Destinations);
- Deserialisator v(d, "Destinations");
-
- for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
- result->set_destination_type(*t, v.member<std::tr1::shared_ptr<Destination> >(stringify(*t)));
-
- return result;
-}
-
const std::tr1::shared_ptr<Destination>
Destination::deserialise(Deserialisation & d)
+
{
Deserialisator v(d, "Destination");
-
std::tr1::shared_ptr<PackageIDSequence> replacing(new PackageIDSequence);
Deserialisator vv(*v.find_remove_member("replacing"), "c");
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
replacing->push_back(vv.member<std::tr1::shared_ptr<const PackageID> >(stringify(n)));
+
return make_shared_ptr(new Destination(make_named_values<Destination>(
value_for<n::replacing>(replacing),
value_for<n::repository>(RepositoryName(v.member<std::string>("repository")))
)));
}
-template class PrivateImplementationPattern<Destinations>;
+void
+Destination::serialise(Serialiser & s) const
+{
+ s.object("Destination")
+ .member(SerialiserFlags<serialise::container, serialise::might_be_null>(), "replacing", replacing())
+ .member(SerialiserFlags<>(), "repository", stringify(repository()))
+ ;
+}
diff --git a/paludis/resolver/destinations.hh b/paludis/resolver/destination.hh
index 8c1c10f..db58df4 100644
--- a/paludis/resolver/destinations.hh
+++ b/paludis/resolver/destination.hh
@@ -17,14 +17,12 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_DESTINATIONS_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_DESTINATIONS_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_DESTINATION_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_DESTINATION_HH 1
-#include <paludis/resolver/destinations-fwd.hh>
+#include <paludis/resolver/destination-fwd.hh>
#include <paludis/resolver/serialise-fwd.hh>
-#include <paludis/resolver/destination_types-fwd.hh>
-#include <paludis/util/named_value.hh>
-#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/attributes.hh>
#include <paludis/name.hh>
#include <paludis/package_id-fwd.hh>
#include <tr1/memory>
@@ -45,34 +43,9 @@ namespace paludis
NamedValue<n::repository, RepositoryName> repository;
void serialise(Serialiser &) const;
-
- static const std::tr1::shared_ptr<Destination> deserialise(
- Deserialisation & d) PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE Destinations :
- private PrivateImplementationPattern<Destinations>
- {
- public:
- Destinations();
- ~Destinations();
-
- const std::tr1::shared_ptr<const Destination> by_type(const DestinationType)
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- void set_destination_type(const DestinationType, const std::tr1::shared_ptr<const Destination> &);
-
- void serialise(Serialiser &) const;
-
- static const std::tr1::shared_ptr<Destinations> deserialise(
- Deserialisation & d) PALUDIS_ATTRIBUTE((warn_unused_result));
+ static const std::tr1::shared_ptr<Destination> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
-
-#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
- extern template class PrivateImplementationPattern<resolver::Destinations>;
-#endif
-
}
#endif
diff --git a/paludis/resolver/destination_types-fwd.hh b/paludis/resolver/destination_types-fwd.hh
index 1fa156b..a16dbb1 100644
--- a/paludis/resolver/destination_types-fwd.hh
+++ b/paludis/resolver/destination_types-fwd.hh
@@ -21,6 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_RESOLVER_DESTINATION_TYPES_FWD_HH 1
#include <paludis/util/attributes.hh>
+#include <paludis/util/options.hh>
#include <iosfwd>
namespace paludis
@@ -30,6 +31,8 @@ namespace paludis
#include <paludis/resolver/destination_types-se.hh>
+ typedef Options<DestinationType> DestinationTypes;
+
}
}
diff --git a/paludis/resolver/qpn_s.cc b/paludis/resolver/qpn_s.cc
deleted file mode 100644
index 31a19c9..0000000
--- a/paludis/resolver/qpn_s.cc
+++ /dev/null
@@ -1,182 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009 Ciaran McCreesh
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis/resolver/qpn_s.hh>
-#include <paludis/resolver/serialise-impl.hh>
-#include <paludis/util/sequence-impl.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/stringify.hh>
-#include <paludis/util/make_named_values.hh>
-#include <paludis/filter.hh>
-#include <paludis/dep_spec.hh>
-#include <paludis/package_id.hh>
-#include <paludis/metadata_key.hh>
-#include <sstream>
-
-using namespace paludis;
-using namespace paludis::resolver;
-
-namespace paludis
-{
- template <>
- struct Implementation<QPN_S>
- {
- QualifiedPackageName package;
- std::tr1::shared_ptr<const SlotName> slot_name_or_null;
-
- Implementation(const QualifiedPackageName & q, const std::tr1::shared_ptr<const SlotName> & s) :
- package(q),
- slot_name_or_null(s)
- {
- }
- };
-}
-
-QPN_S::QPN_S(const QualifiedPackageName & q, const std::tr1::shared_ptr<const SlotName> & s) :
- PrivateImplementationPattern<QPN_S>(new Implementation<QPN_S>(q, s))
-{
-}
-
-QPN_S::QPN_S(const PackageDepSpec & p, const std::tr1::shared_ptr<const SlotName> & s) :
- PrivateImplementationPattern<QPN_S>(new Implementation<QPN_S>(*p.package_ptr(), s))
-{
-}
-
-QPN_S::QPN_S(const std::tr1::shared_ptr<const PackageID> & id) :
- PrivateImplementationPattern<QPN_S>(new Implementation<QPN_S>(id->name(),
- id->slot_key() ? make_shared_ptr(new SlotName(id->slot_key()->value())) : make_null_shared_ptr()))
-{
-}
-
-QPN_S::QPN_S(const QPN_S & other) :
- PrivateImplementationPattern<QPN_S>(new Implementation<QPN_S>(other.package(), other.slot_name_or_null()))
-{
-}
-
-QPN_S::~QPN_S()
-{
-}
-
-const QualifiedPackageName
-QPN_S::package() const
-{
- return _imp->package;
-}
-
-const std::tr1::shared_ptr<const SlotName>
-QPN_S::slot_name_or_null() const
-{
- return _imp->slot_name_or_null;
-}
-
-bool
-QPN_S::operator< (const QPN_S & other) const
-{
- if (package() < other.package())
- return true;
- if (package() > other.package())
- return false;
-
- /* no slot orders before any slot */
- if (slot_name_or_null())
- {
- if (other.slot_name_or_null())
- return *slot_name_or_null() < *other.slot_name_or_null();
- else
- return false;
- }
- else
- {
- if (other.slot_name_or_null())
- return true;
- else
- return false;
- }
-}
-
-bool
-QPN_S::operator== (const QPN_S & other) const
-{
- if (! (package() == other.package()))
- return false;
-
- if (slot_name_or_null())
- return other.slot_name_or_null() && *slot_name_or_null() == *other.slot_name_or_null();
- else
- return ! other.slot_name_or_null();
-}
-
-std::ostream &
-paludis::resolver::operator<< (std::ostream & s, const QPN_S & q)
-{
- std::stringstream ss;
- ss << q.package();
- if (q.slot_name_or_null())
- ss << ":" << *q.slot_name_or_null();
- else
- ss << " (no slot)";
-
- s << ss.str();
- return s;
-}
-
-Filter
-QPN_S::make_slot_filter() const
-{
- if (slot_name_or_null())
- return filter::Slot(*slot_name_or_null());
- else
- return filter::NoSlot();
-}
-
-QPN_S &
-QPN_S::operator= (const QPN_S & other)
-{
- if (this != &other)
- {
- _imp->package = other._imp->package;
- _imp->slot_name_or_null = other._imp->slot_name_or_null;
- }
- return *this;
-}
-
-void
-QPN_S::serialise(Serialiser & s) const
-{
- s.object("QPN_S")
- .member(SerialiserFlags<>(), "package", stringify(package()))
- .member(SerialiserFlags<>(), "slot", slot_name_or_null() ? stringify(*slot_name_or_null()) : "")
- ;
-}
-
-QPN_S
-QPN_S::deserialise(Deserialisation & d)
-{
- Deserialisator v(d, "QPN_S");
- std::string slot_str(v.member<std::string>("slot"));
- return QPN_S(
- QualifiedPackageName(v.member<std::string>("package")),
- ! slot_str.empty() ? make_shared_ptr(new SlotName(slot_str)) : make_null_shared_ptr());
-}
-
-template class PrivateImplementationPattern<QPN_S>;
-template class Sequence<QPN_S>;
-template class WrappedForwardIterator<QPN_S_Sequence::ConstIteratorTag, const QPN_S>;
-
diff --git a/paludis/resolver/qpn_s.hh b/paludis/resolver/qpn_s.hh
deleted file mode 100644
index 4917b62..0000000
--- a/paludis/resolver/qpn_s.hh
+++ /dev/null
@@ -1,75 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009 Ciaran McCreesh
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_QPN_S_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_QPN_S_HH 1
-
-#include <paludis/resolver/qpn_s-fwd.hh>
-#include <paludis/resolver/serialise-fwd.hh>
-#include <paludis/util/named_value.hh>
-#include <paludis/util/attributes.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/name.hh>
-#include <paludis/filter-fwd.hh>
-#include <paludis/dep_spec-fwd.hh>
-#include <paludis/package_id-fwd.hh>
-#include <tr1/memory>
-
-namespace paludis
-{
- namespace n
- {
- struct package;
- struct slot_name_or_null;
- }
-
- namespace resolver
- {
- class PALUDIS_VISIBLE QPN_S :
- private PrivateImplementationPattern<QPN_S>
- {
- public:
- QPN_S(const QualifiedPackageName &, const std::tr1::shared_ptr<const SlotName> &);
- QPN_S(const PackageDepSpec &, const std::tr1::shared_ptr<const SlotName> &);
- explicit QPN_S(const std::tr1::shared_ptr<const PackageID> &);
- QPN_S(const QPN_S &);
- QPN_S & operator= (const QPN_S & other);
- ~QPN_S();
-
- const QualifiedPackageName package() const PALUDIS_ATTRIBUTE((warn_unused_result));
- const std::tr1::shared_ptr<const SlotName> slot_name_or_null() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- Filter make_slot_filter() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- bool operator< (const QPN_S & other) const PALUDIS_ATTRIBUTE((warn_unused_result));
- bool operator== (const QPN_S & other) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- void serialise(Serialiser &) const;
-
- static QPN_S deserialise(
- Deserialisation & d) PALUDIS_ATTRIBUTE((warn_unused_result));
- };
- }
-
-#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
- extern template class PrivateImplementationPattern<resolver::QPN_S>;
-#endif
-}
-
-#endif
diff --git a/paludis/resolver/reason.cc b/paludis/resolver/reason.cc
index 6bd93d3..3333347 100644
--- a/paludis/resolver/reason.cc
+++ b/paludis/resolver/reason.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/resolver/reason.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/sanitised_dependencies.hh>
#include <paludis/resolver/serialise-impl.hh>
#include <paludis/util/stringify.hh>
@@ -44,10 +44,13 @@ namespace paludis
struct Implementation<DependencyReason>
{
const std::tr1::shared_ptr<const PackageID> from_id;
+ const Resolvent from_resolvent;
const SanitisedDependency dep;
- Implementation(const std::tr1::shared_ptr<const PackageID> & i, const SanitisedDependency & d) :
+ Implementation(const std::tr1::shared_ptr<const PackageID> & i,
+ const Resolvent & r, const SanitisedDependency & d) :
from_id(i),
+ from_resolvent(r),
dep(d)
{
}
@@ -55,8 +58,9 @@ namespace paludis
}
DependencyReason::DependencyReason(const std::tr1::shared_ptr<const PackageID> & i,
+ const Resolvent & r,
const SanitisedDependency & d) :
- PrivateImplementationPattern<DependencyReason>(new Implementation<DependencyReason>(i, d))
+ PrivateImplementationPattern<DependencyReason>(new Implementation<DependencyReason>(i, r, d))
{
}
@@ -70,6 +74,12 @@ DependencyReason::from_id() const
return _imp->from_id;
}
+const Resolvent
+DependencyReason::from_resolvent() const
+{
+ return _imp->from_resolvent;
+}
+
const SanitisedDependency &
DependencyReason::sanitised_dependency() const
{
@@ -81,6 +91,7 @@ DependencyReason::serialise(Serialiser & s) const
{
s.object("DependencyReason")
.member(SerialiserFlags<serialise::might_be_null>(), "from_id", from_id())
+ .member(SerialiserFlags<>(), "from_resolvent", from_resolvent())
.member(SerialiserFlags<>(), "sanitised_dependency", sanitised_dependency())
;
}
@@ -165,6 +176,7 @@ Reason::deserialise(Deserialisation & d)
const std::tr1::shared_ptr<const PackageID> from_id(v.member<std::tr1::shared_ptr<const PackageID> >("from_id"));
return make_shared_ptr(new DependencyReason(
from_id,
+ v.member<Resolvent>("from_resolvent"),
SanitisedDependency::deserialise(*v.find_remove_member("sanitised_dependency"), from_id))
);
}
diff --git a/paludis/resolver/reason.hh b/paludis/resolver/reason.hh
index b6d0f8c..dba4c4a 100644
--- a/paludis/resolver/reason.hh
+++ b/paludis/resolver/reason.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_RESOLVER_REASON_HH 1
#include <paludis/resolver/reason-fwd.hh>
-#include <paludis/resolver/qpn_s-fwd.hh>
+#include <paludis/resolver/resolvent-fwd.hh>
#include <paludis/resolver/sanitised_dependencies-fwd.hh>
#include <paludis/resolver/serialise-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
@@ -64,11 +64,13 @@ namespace paludis
public:
DependencyReason(
const std::tr1::shared_ptr<const PackageID> & id,
+ const Resolvent &,
const SanitisedDependency & s);
~DependencyReason();
const std::tr1::shared_ptr<const PackageID> from_id() const;
+ const Resolvent from_resolvent() const;
const SanitisedDependency & sanitised_dependency() const;
virtual void serialise(Serialiser &) const;
diff --git a/paludis/resolver/resolution.cc b/paludis/resolver/resolution.cc
index 14aa889..a3841c0 100644
--- a/paludis/resolver/resolution.cc
+++ b/paludis/resolver/resolution.cc
@@ -22,7 +22,6 @@
#include <paludis/resolver/arrow.hh>
#include <paludis/resolver/decision.hh>
#include <paludis/resolver/serialise-impl.hh>
-#include <paludis/resolver/destinations.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/join.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -42,8 +41,7 @@ Resolution::serialise(Serialiser & s) const
.member(SerialiserFlags<serialise::container, serialise::might_be_null>(), "arrows", arrows())
.member(SerialiserFlags<>(), "constraints", *constraints())
.member(SerialiserFlags<serialise::might_be_null>(), "decision", decision())
- .member(SerialiserFlags<serialise::might_be_null>(), "destinations", destinations())
- .member(SerialiserFlags<>(), "qpn_s", qpn_s())
+ .member(SerialiserFlags<>(), "resolvent", resolvent())
;
}
@@ -62,8 +60,7 @@ Resolution::deserialise(Deserialisation & d)
value_for<n::arrows>(arrows),
value_for<n::constraints>(v.member<std::tr1::shared_ptr<Constraints> >("constraints")),
value_for<n::decision>(v.member<std::tr1::shared_ptr<Decision> >("decision")),
- value_for<n::destinations>(v.member<std::tr1::shared_ptr<Destinations> >("destinations")),
- value_for<n::qpn_s>(v.member<QPN_S>("qpn_s")),
+ value_for<n::resolvent>(v.member<Resolvent>("resolvent")),
value_for<n::sanitised_dependencies>(make_null_shared_ptr())
)));
}
diff --git a/paludis/resolver/resolution.hh b/paludis/resolver/resolution.hh
index 59abe1e..757cd2b 100644
--- a/paludis/resolver/resolution.hh
+++ b/paludis/resolver/resolution.hh
@@ -24,9 +24,8 @@
#include <paludis/resolver/arrow-fwd.hh>
#include <paludis/resolver/constraint-fwd.hh>
#include <paludis/resolver/decision-fwd.hh>
-#include <paludis/resolver/destinations-fwd.hh>
#include <paludis/resolver/sanitised_dependencies-fwd.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/util/named_value.hh>
#include <tr1/memory>
@@ -38,8 +37,7 @@ namespace paludis
struct arrows;
struct constraints;
struct decision;
- struct destinations;
- struct qpn_s;
+ struct resolvent;
struct sanitised_dependencies;
}
@@ -51,8 +49,7 @@ namespace paludis
NamedValue<n::arrows, std::tr1::shared_ptr<ArrowSequence> > arrows;
NamedValue<n::constraints, std::tr1::shared_ptr<Constraints> > constraints;
NamedValue<n::decision, std::tr1::shared_ptr<Decision> > decision;
- NamedValue<n::destinations, std::tr1::shared_ptr<Destinations> > destinations;
- NamedValue<n::qpn_s, QPN_S> qpn_s;
+ NamedValue<n::resolvent, Resolvent> resolvent;
NamedValue<n::sanitised_dependencies, std::tr1::shared_ptr<SanitisedDependencies> > sanitised_dependencies;
void serialise(Serialiser &) const;
diff --git a/paludis/resolver/qpn_s-fwd.hh b/paludis/resolver/resolvent-fwd.hh
index f89f645..5db5297 100644
--- a/paludis/resolver/qpn_s-fwd.hh
+++ b/paludis/resolver/resolvent-fwd.hh
@@ -17,22 +17,28 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_QPN_S_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_QPN_S_FWD_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_RESOLVENT_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_RESOLVENT_FWD_HH 1
-#include <paludis/util/attributes.hh>
#include <paludis/util/sequence-fwd.hh>
+#include <paludis/util/attributes.hh>
+#include <paludis/filter-fwd.hh>
#include <iosfwd>
namespace paludis
{
namespace resolver
{
- struct QPN_S;
+ struct Resolvent;
+
+ typedef Sequence<Resolvent> Resolvents;
+
+ std::ostream & operator<< (std::ostream &, const Resolvent &) PALUDIS_VISIBLE;
- std::ostream & operator<< (std::ostream & s, const QPN_S &) PALUDIS_VISIBLE;
+ bool operator< (const Resolvent &, const Resolvent &) PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE;
+ bool operator== (const Resolvent &, const Resolvent &) PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE;
- typedef Sequence<QPN_S> QPN_S_Sequence;
+ Filter make_slot_filter(const Resolvent &) PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE;
}
}
diff --git a/paludis/resolver/resolvent.cc b/paludis/resolver/resolvent.cc
new file mode 100644
index 0000000..371e9a0
--- /dev/null
+++ b/paludis/resolver/resolvent.cc
@@ -0,0 +1,167 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2009 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <paludis/resolver/resolvent.hh>
+#include <paludis/resolver/serialise-impl.hh>
+#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/make_named_values.hh>
+#include <paludis/util/destringify.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/filter.hh>
+#include <paludis/package_id.hh>
+#include <paludis/metadata_key.hh>
+
+using namespace paludis;
+using namespace paludis::resolver;
+
+bool
+paludis::resolver::operator< (const Resolvent & a, const Resolvent & b)
+{
+ if (a.package() < b.package())
+ return true;
+ if (a.package() > b.package())
+ return false;
+
+ /* no slot orders before slot */
+ if (a.slot_name_or_null() && b.slot_name_or_null())
+ {
+ if (*a.slot_name_or_null() < *b.slot_name_or_null())
+ return true;
+ if (*a.slot_name_or_null() > *b.slot_name_or_null())
+ return false;
+ }
+ else if (a.slot_name_or_null())
+ return false;
+ else if (b.slot_name_or_null())
+ return true;
+
+ return a.destination_type() < b.destination_type();
+}
+
+bool
+paludis::resolver::operator== (const Resolvent & a, const Resolvent & b)
+{
+ if (a.package() != b.package())
+ return false;
+
+ if (a.slot_name_or_null() != b.slot_name_or_null())
+ return false;
+
+ if (a.slot_name_or_null() && *a.slot_name_or_null() != *b.slot_name_or_null())
+ return false;
+
+ if (a.destination_type() != b.destination_type())
+ return false;
+
+ return true;
+}
+
+#ifdef PALUDIS_HAVE_DEFAULT_DELETED
+
+Resolvent::Resolvent(const Resolvent &) = default;
+
+#else
+
+Resolvent::Resolvent(const Resolvent &) :
+ destination_type(other.destination_type()),
+ package(other.package()),
+ slot_name_or_null(other.slot_name_or_null())
+{
+}
+
+#endif
+
+Resolvent::Resolvent(
+ const PackageDepSpec & spec,
+ const std::tr1::shared_ptr<const SlotName> & s,
+ const DestinationType t) :
+ destination_type(value_for<n::destination_type>(t)),
+ package(value_for<n::package>(*spec.package_ptr())),
+ slot_name_or_null(s)
+{
+}
+
+Resolvent::Resolvent(
+ const QualifiedPackageName & n,
+ const std::tr1::shared_ptr<const SlotName> & s,
+ const DestinationType t) :
+ destination_type(value_for<n::destination_type>(t)),
+ package(value_for<n::package>(n)),
+ slot_name_or_null(s)
+{
+}
+
+Resolvent::Resolvent(
+ const std::tr1::shared_ptr<const PackageID> & id,
+ const DestinationType t) :
+ destination_type(value_for<n::destination_type>(t)),
+ package(id->name()),
+ slot_name_or_null(id->slot_key() ? make_shared_ptr(new SlotName(id->slot_key()->value())) : make_null_shared_ptr())
+{
+}
+
+void
+Resolvent::serialise(Serialiser & s) const
+{
+ s.object("Resolvent")
+ .member(SerialiserFlags<>(), "destination_type", stringify(destination_type()))
+ .member(SerialiserFlags<>(), "package", stringify(package()))
+ .member(SerialiserFlags<>(), "slot", slot_name_or_null() ? stringify(*slot_name_or_null()) : "")
+ ;
+}
+
+const Resolvent
+Resolvent::deserialise(Deserialisation & d)
+{
+ Deserialisator v(d, "Resolvent");
+
+ std::string s(v.member<std::string>("slot"));
+
+ return Resolvent(
+ QualifiedPackageName(v.member<std::string>("package")),
+ s.empty() ? make_null_shared_ptr() : make_shared_ptr(new SlotName(s)),
+ destringify<DestinationType>(v.member<std::string>("destination_type"))
+ );
+}
+
+Filter
+paludis::resolver::make_slot_filter(const Resolvent & r)
+{
+ if (r.slot_name_or_null())
+ return filter::Slot(*r.slot_name_or_null());
+ else
+ return filter::NoSlot();
+}
+
+std::ostream &
+paludis::resolver::operator<< (std::ostream & s, const Resolvent & r)
+{
+ s << r.package();
+ if (r.slot_name_or_null())
+ s << ":" << *r.slot_name_or_null();
+ else
+ s << ":(no slot)";
+ s << " -> " << r.destination_type();
+ return s;
+}
+
+template class Sequence<Resolvent>;
+template class WrappedForwardIterator<Resolvents::ConstIteratorTag, Resolvent>;
+
diff --git a/paludis/resolver/resolvent.hh b/paludis/resolver/resolvent.hh
new file mode 100644
index 0000000..f028c44
--- /dev/null
+++ b/paludis/resolver/resolvent.hh
@@ -0,0 +1,60 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2009 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_RESOLVENT_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_RESOLVENT_HH 1
+
+#include <paludis/resolver/resolvent-fwd.hh>
+#include <paludis/resolver/destination_types-fwd.hh>
+#include <paludis/resolver/serialise-fwd.hh>
+#include <paludis/util/named_value.hh>
+#include <paludis/name.hh>
+#include <paludis/dep_spec-fwd.hh>
+#include <paludis/package_id-fwd.hh>
+#include <tr1/memory>
+
+namespace paludis
+{
+ namespace n
+ {
+ struct destination_type;
+ struct package;
+ struct slot_name_or_null;
+ }
+
+ namespace resolver
+ {
+ struct Resolvent
+ {
+ NamedValue<n::destination_type, DestinationType> destination_type;
+ NamedValue<n::package, QualifiedPackageName> package;
+ NamedValue<n::slot_name_or_null, std::tr1::shared_ptr<const SlotName> > slot_name_or_null;
+
+ Resolvent(const Resolvent &);
+ Resolvent(const QualifiedPackageName &, const std::tr1::shared_ptr<const SlotName> &, const DestinationType);
+ Resolvent(const PackageDepSpec &, const std::tr1::shared_ptr<const SlotName> &, const DestinationType);
+ Resolvent(const std::tr1::shared_ptr<const PackageID> &, const DestinationType);
+
+ void serialise(Serialiser &) const;
+ static const Resolvent deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+ }
+}
+
+#endif
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index a5934b3..9e1e66e 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -21,15 +21,15 @@
#include <paludis/resolver/resolution.hh>
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/reason.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/sanitised_dependencies.hh>
#include <paludis/resolver/arrow.hh>
#include <paludis/resolver/decision.hh>
-#include <paludis/resolver/destinations.hh>
#include <paludis/resolver/resolver_functions.hh>
#include <paludis/resolver/suggest_restart.hh>
#include <paludis/resolver/resolutions.hh>
#include <paludis/resolver/serialise.hh>
+#include <paludis/resolver/destination.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/log.hh>
@@ -37,6 +37,7 @@
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/mutex.hh>
+#include <paludis/util/enum_iterator.hh>
#include <paludis/environment.hh>
#include <paludis/notifier_callback.hh>
#include <paludis/dep_spec_flattener.hh>
@@ -65,7 +66,7 @@
using namespace paludis;
using namespace paludis::resolver;
-typedef std::map<QPN_S, std::tr1::shared_ptr<Resolution> > ResolutionsByQPN_SMap;
+typedef std::map<Resolvent, std::tr1::shared_ptr<Resolution> > ResolutionsByResolventMap;
typedef std::map<QualifiedPackageName, std::set<QualifiedPackageName> > Rewrites;
namespace paludis
@@ -76,7 +77,7 @@ namespace paludis
const Environment * const env;
const ResolverFunctions fns;
- ResolutionsByQPN_SMap resolutions_by_qpn_s;
+ ResolutionsByResolventMap resolutions_by_resolvent;
mutable Mutex rewrites_mutex;
mutable Rewrites rewrites;
@@ -134,7 +135,7 @@ Resolver::_resolve_decide_with_dependencies()
break;
changed = false;
- for (ResolutionsByQPN_SMap::iterator i(_imp->resolutions_by_qpn_s.begin()), i_end(_imp->resolutions_by_qpn_s.end()) ;
+ for (ResolutionsByResolventMap::iterator i(_imp->resolutions_by_resolvent.begin()), i_end(_imp->resolutions_by_resolvent.end()) ;
i != i_end ; ++i)
{
/* we've already decided */
@@ -177,50 +178,53 @@ Resolver::_resolve_destinations()
{
Context context("When resolving destinations:");
- for (ResolutionsByQPN_SMap::iterator i(_imp->resolutions_by_qpn_s.begin()), i_end(_imp->resolutions_by_qpn_s.end()) ;
+ for (ResolutionsByResolventMap::iterator i(_imp->resolutions_by_resolvent.begin()), i_end(_imp->resolutions_by_resolvent.end()) ;
i != i_end ; ++i)
{
- if (i->second->destinations())
+ if (i->second->decision()->destination())
continue;
- i->second->destinations() = _make_destinations_for(i->first, i->second);
+ i->second->decision()->destination() = _make_destination_for(i->first, i->second);
}
}
-const std::tr1::shared_ptr<Destinations>
-Resolver::_make_destinations_for(
- const QPN_S & qpn_s,
+const std::tr1::shared_ptr<Destination>
+Resolver::_make_destination_for(
+ const Resolvent & resolvent,
const std::tr1::shared_ptr<const Resolution> & resolution) const
{
- std::tr1::shared_ptr<Destinations> result(new Destinations);
-
switch (resolution->decision()->kind())
{
case dk_existing_no_change:
case dk_nothing_no_change:
case dk_unable_to_decide:
- case last_dk:
- break;
+ return make_null_shared_ptr();
case dk_changes_to_make:
+ switch (resolvent.destination_type())
{
- bool requires_slash(true); // (resolution->constraints()->for_destination_type(dt_slash)->required());
- if (requires_slash)
- result->set_destination_type(dt_slash, _make_slash_destination_for(qpn_s, resolution));
+ case dt_slash:
+ return _make_slash_destination_for(resolvent, resolution);
+ break;
+
+ case last_dt:
+ break;
}
break;
- }
+ case last_dk:
+ break;
+ }
- return result;
+ throw InternalError(PALUDIS_HERE, "resolver bug: unhandled dt");
}
-
const std::tr1::shared_ptr<Destination>
-Resolver::_make_slash_destination_for(const QPN_S & qpn_s,
+Resolver::_make_slash_destination_for(
+ const Resolvent & resolvent,
const std::tr1::shared_ptr<const Resolution> & resolution) const
{
- Context context("When finding / destination for '" + stringify(qpn_s) + "':");
+ Context context("When finding / destination for '" + stringify(resolvent) + "':");
if ((! resolution->decision()) || (! resolution->decision()->if_package_id()))
throw InternalError(PALUDIS_HERE, "resolver bug: not decided yet");
@@ -310,22 +314,22 @@ Resolver::add_target_with_reason(const PackageDepSpec & spec, const std::tr1::sh
_imp->env->trigger_notifier_callback(NotifierCallbackResolverStepEvent());
- std::tr1::shared_ptr<const QPN_S_Sequence> qpn_s_s(_get_qpn_s_s_for(spec, reason));
- if (qpn_s_s->empty())
- qpn_s_s = _get_error_qpn_s_s_for(spec, reason);
+ std::tr1::shared_ptr<const Resolvents> resolvents(_get_resolvents_for(spec, reason));
+ if (resolvents->empty())
+ resolvents = _get_error_resolvents_for(spec, reason);
- for (QPN_S_Sequence::ConstIterator qpn_s(qpn_s_s->begin()), qpn_s_end(qpn_s_s->end()) ;
- qpn_s != qpn_s_end ; ++qpn_s)
+ for (Resolvents::ConstIterator r(resolvents->begin()), r_end(resolvents->end()) ;
+ r != r_end ; ++r)
{
- Context context_2("When adding constraints from target '" + stringify(spec) + "' to qpn:s '"
- + stringify(*qpn_s) + "':");
+ Context context_2("When adding constraints from target '" + stringify(spec) + "' to resolvent '"
+ + stringify(*r) + "':");
- const std::tr1::shared_ptr<Resolution> dep_resolution(_resolution_for_qpn_s(*qpn_s, true));
- const std::tr1::shared_ptr<ConstraintSequence> constraints(_make_constraints_from_target(*qpn_s, spec, reason));
+ const std::tr1::shared_ptr<Resolution> dep_resolution(_resolution_for_resolvent(*r, true));
+ const std::tr1::shared_ptr<ConstraintSequence> constraints(_make_constraints_from_target(*r, spec, reason));
for (ConstraintSequence::ConstIterator c(constraints->begin()), c_end(constraints->end()) ;
c != c_end ; ++c)
- _apply_resolution_constraint(*qpn_s, dep_resolution, *c);
+ _apply_resolution_constraint(*r, dep_resolution, *c);
}
}
@@ -355,53 +359,52 @@ Resolver::add_target(const SetName & set_name)
}
const std::tr1::shared_ptr<Resolution>
-Resolver::_create_resolution_for_qpn_s(const QPN_S & qpn_s) const
+Resolver::_create_resolution_for_resolvent(const Resolvent & r) const
{
return make_shared_ptr(new Resolution(make_named_values<Resolution>(
value_for<n::already_ordered>(false),
value_for<n::arrows>(make_shared_ptr(new ArrowSequence)),
- value_for<n::constraints>(_initial_constraints_for(qpn_s)),
+ value_for<n::constraints>(_initial_constraints_for(r)),
value_for<n::decision>(make_null_shared_ptr()),
- value_for<n::destinations>(make_null_shared_ptr()),
- value_for<n::qpn_s>(qpn_s),
+ value_for<n::resolvent>(r),
value_for<n::sanitised_dependencies>(make_null_shared_ptr())
)));
}
const std::tr1::shared_ptr<Resolution>
-Resolver::_resolution_for_qpn_s(const QPN_S & qpn_s, const bool create)
+Resolver::_resolution_for_resolvent(const Resolvent & r, const bool create)
{
- ResolutionsByQPN_SMap::iterator i(_imp->resolutions_by_qpn_s.find(qpn_s));
- if (_imp->resolutions_by_qpn_s.end() == i)
+ ResolutionsByResolventMap::iterator i(_imp->resolutions_by_resolvent.find(r));
+ if (_imp->resolutions_by_resolvent.end() == i)
{
if (create)
{
- std::tr1::shared_ptr<Resolution> resolution(_create_resolution_for_qpn_s(qpn_s));
- i = _imp->resolutions_by_qpn_s.insert(std::make_pair(qpn_s, resolution)).first;
+ std::tr1::shared_ptr<Resolution> resolution(_create_resolution_for_resolvent(r));
+ i = _imp->resolutions_by_resolvent.insert(std::make_pair(r, resolution)).first;
_imp->resolution_lists->all()->append(resolution);
}
else
throw InternalError(PALUDIS_HERE, "resolver bug: expected resolution for "
- + stringify(qpn_s) + " to exist, but it doesn't");
+ + stringify(r) + " to exist, but it doesn't");
}
return i->second;
}
const std::tr1::shared_ptr<Resolution>
-Resolver::_resolution_for_qpn_s(const QPN_S & qpn_s) const
+Resolver::_resolution_for_resolvent(const Resolvent & r) const
{
- ResolutionsByQPN_SMap::const_iterator i(_imp->resolutions_by_qpn_s.find(qpn_s));
- if (_imp->resolutions_by_qpn_s.end() == i)
+ ResolutionsByResolventMap::const_iterator i(_imp->resolutions_by_resolvent.find(r));
+ if (_imp->resolutions_by_resolvent.end() == i)
throw InternalError(PALUDIS_HERE, "resolver bug: expected resolution for "
- + stringify(qpn_s) + " to exist, but it doesn't");
+ + stringify(r) + " to exist, but it doesn't");
return i->second;
}
const std::tr1::shared_ptr<ConstraintSequence>
Resolver::_make_constraints_from_target(
- const QPN_S & qpn_s,
+ const Resolvent & resolvent,
const PackageDepSpec & spec,
const std::tr1::shared_ptr<const Reason> & reason) const
{
@@ -412,13 +415,13 @@ Resolver::_make_constraints_from_target(
value_for<n::reason>(reason),
value_for<n::spec>(spec),
value_for<n::untaken>(false),
- value_for<n::use_existing>(_imp->fns.get_use_existing_fn()(qpn_s, spec, reason))
+ value_for<n::use_existing>(_imp->fns.get_use_existing_fn()(resolvent, spec, reason))
))));
return result;
}
const std::tr1::shared_ptr<ConstraintSequence>
-Resolver::_make_constraints_from_dependency(const QPN_S & qpn_s, const SanitisedDependency & dep,
+Resolver::_make_constraints_from_dependency(const Resolvent & resolvent, const SanitisedDependency & dep,
const std::tr1::shared_ptr<const Reason> & reason) const
{
const std::tr1::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
@@ -429,10 +432,10 @@ Resolver::_make_constraints_from_dependency(const QPN_S & qpn_s, const Sanitised
value_for<n::nothing_is_fine_too>(false),
value_for<n::reason>(reason),
value_for<n::spec>(*dep.spec().if_package()),
- value_for<n::untaken>(! _imp->fns.take_dependency_fn()(qpn_s, dep,
- reason)),
- value_for<n::use_existing>(_imp->fns.get_use_existing_fn()(qpn_s, *dep.spec().if_package(),
- reason))
+ value_for<n::untaken>(! _imp->fns.take_dependency_fn()(
+ resolvent, dep, reason)),
+ value_for<n::use_existing>(_imp->fns.get_use_existing_fn()(
+ resolvent, *dep.spec().if_package(), reason))
))));
}
else if (dep.spec().if_block())
@@ -459,19 +462,19 @@ Resolver::_make_constraints_from_dependency(const QPN_S & qpn_s, const Sanitised
void
Resolver::_apply_resolution_constraint(
- const QPN_S & qpn_s,
+ const Resolvent & resolvent,
const std::tr1::shared_ptr<Resolution> & resolution,
const std::tr1::shared_ptr<const Constraint> & constraint)
{
if (resolution->decision())
- if (! _verify_new_constraint(qpn_s, resolution, constraint))
- _made_wrong_decision(qpn_s, resolution, constraint);
+ if (! _verify_new_constraint(resolvent, resolution, constraint))
+ _made_wrong_decision(resolvent, resolution, constraint);
resolution->constraints()->add(constraint);
}
bool
-Resolver::_verify_new_constraint(const QPN_S &,
+Resolver::_verify_new_constraint(const Resolvent &,
const std::tr1::shared_ptr<const Resolution> & resolution,
const std::tr1::shared_ptr<const Constraint> & constraint)
{
@@ -522,7 +525,7 @@ Resolver::_verify_new_constraint(const QPN_S &,
}
void
-Resolver::_made_wrong_decision(const QPN_S & qpn_s,
+Resolver::_made_wrong_decision(const Resolvent & resolvent,
const std::tr1::shared_ptr<Resolution> & resolution,
const std::tr1::shared_ptr<const Constraint> & constraint)
{
@@ -530,26 +533,26 @@ Resolver::_made_wrong_decision(const QPN_S & qpn_s,
std::tr1::shared_ptr<Resolution> adapted_resolution(make_shared_ptr(new Resolution(*resolution)));
adapted_resolution->constraints()->add(constraint);
- const std::tr1::shared_ptr<Decision> decision(_try_to_find_decision_for(qpn_s, adapted_resolution));
+ const std::tr1::shared_ptr<Decision> decision(_try_to_find_decision_for(resolvent, adapted_resolution));
if (decision)
- _suggest_restart_with(qpn_s, resolution, constraint, decision);
+ _suggest_restart_with(resolvent, resolution, constraint, decision);
else
- resolution->decision() = _cannot_decide_for(qpn_s, adapted_resolution);
+ resolution->decision() = _cannot_decide_for(resolvent, adapted_resolution);
}
void
-Resolver::_suggest_restart_with(const QPN_S & qpn_s,
+Resolver::_suggest_restart_with(const Resolvent & resolvent,
const std::tr1::shared_ptr<const Resolution> & resolution,
const std::tr1::shared_ptr<const Constraint> & constraint,
const std::tr1::shared_ptr<const Decision> & decision) const
{
- throw SuggestRestart(qpn_s, resolution->decision(), constraint, decision,
- _make_constraint_for_preloading(qpn_s, decision, constraint->destination_type()));
+ throw SuggestRestart(resolvent, resolution->decision(), constraint, decision,
+ _make_constraint_for_preloading(resolvent, decision, constraint->destination_type()));
}
const std::tr1::shared_ptr<const Constraint>
Resolver::_make_constraint_for_preloading(
- const QPN_S & qpn_s,
+ const Resolvent & resolvent,
const std::tr1::shared_ptr<const Decision> & d,
const DestinationType t) const
{
@@ -565,33 +568,33 @@ Resolver::_make_constraint_for_preloading(
value_for<n::spec>(d->if_package_id()->uniquely_identifying_spec()),
value_for<n::untaken>(! d->taken()),
value_for<n::use_existing>(_imp->fns.get_use_existing_fn()(
- qpn_s, d->if_package_id()->uniquely_identifying_spec(), reason))
+ resolvent, d->if_package_id()->uniquely_identifying_spec(), reason))
)));
}
void
-Resolver::_decide(const QPN_S & qpn_s, const std::tr1::shared_ptr<Resolution> & resolution)
+Resolver::_decide(const Resolvent & resolvent, const std::tr1::shared_ptr<Resolution> & resolution)
{
- Context context("When deciding upon an origin ID to use for '" + stringify(qpn_s) + "':");
+ Context context("When deciding upon an origin ID to use for '" + stringify(resolvent) + "':");
- std::tr1::shared_ptr<Decision> decision(_try_to_find_decision_for(qpn_s, resolution));
+ std::tr1::shared_ptr<Decision> decision(_try_to_find_decision_for(resolvent, resolution));
if (decision)
resolution->decision() = decision;
else
- resolution->decision() = _cannot_decide_for(qpn_s, resolution);
+ resolution->decision() = _cannot_decide_for(resolvent, resolution);
}
void
-Resolver::_add_dependencies(const QPN_S & our_qpn_s, const std::tr1::shared_ptr<Resolution> & our_resolution)
+Resolver::_add_dependencies(const Resolvent & our_resolvent, const std::tr1::shared_ptr<Resolution> & our_resolution)
{
if (! our_resolution->decision()->if_package_id())
throw InternalError(PALUDIS_HERE, "resolver bug: not decided. shouldn't happen.");
- Context context("When adding dependencies for '" + stringify(our_qpn_s) + "' with '"
+ Context context("When adding dependencies for '" + stringify(our_resolvent) + "' with '"
+ stringify(*our_resolution->decision()->if_package_id()) + "':");
const std::tr1::shared_ptr<SanitisedDependencies> deps(new SanitisedDependencies);
- deps->populate(*this, our_resolution->decision()->if_package_id());
+ deps->populate(*this, our_resolvent, our_resolution->decision()->if_package_id());
our_resolution->sanitised_dependencies() = deps;
for (SanitisedDependencies::ConstIterator s(deps->begin()), s_end(deps->end()) ;
@@ -599,48 +602,47 @@ Resolver::_add_dependencies(const QPN_S & our_qpn_s, const std::tr1::shared_ptr<
{
Context context_2("When handling dependency '" + stringify(s->spec()) + "':");
- if (! _care_about_dependency_spec(our_qpn_s, our_resolution, *s))
+ if (! _care_about_dependency_spec(our_resolvent, our_resolution, *s))
continue;
const std::tr1::shared_ptr<DependencyReason> reason(new DependencyReason(
- our_resolution->decision()->if_package_id(), *s));
+ our_resolution->decision()->if_package_id(), our_resolvent, *s));
- std::tr1::shared_ptr<const QPN_S_Sequence> qpn_s_s;
+ std::tr1::shared_ptr<const Resolvents> resolvents;
if (s->spec().if_package())
- qpn_s_s = _get_qpn_s_s_for(*s->spec().if_package(), reason);
+ resolvents = _get_resolvents_for(*s->spec().if_package(), reason);
else
- qpn_s_s = _get_qpn_s_s_for_blocker(*s->spec().if_block());
+ resolvents = _get_resolvents_for_blocker(*s->spec().if_block());
- if (qpn_s_s->empty())
+ if (resolvents->empty())
{
if (s->spec().if_package())
- qpn_s_s = _get_error_qpn_s_s_for(*s->spec().if_package(), reason);
+ resolvents = _get_error_resolvents_for(*s->spec().if_package(), reason);
else
{
/* blocking on something that doesn't exist is fine */
- qpn_s_s.reset(new QPN_S_Sequence);
}
}
- for (QPN_S_Sequence::ConstIterator qpn_s(qpn_s_s->begin()), qpn_s_end(qpn_s_s->end()) ;
- qpn_s != qpn_s_end ; ++qpn_s)
+ for (Resolvents::ConstIterator r(resolvents->begin()), r_end(resolvents->end()) ;
+ r != r_end ; ++r)
{
- const std::tr1::shared_ptr<Resolution> dep_resolution(_resolution_for_qpn_s(*qpn_s, true));
- const std::tr1::shared_ptr<ConstraintSequence> constraints(_make_constraints_from_dependency(our_qpn_s, *s, reason));
+ const std::tr1::shared_ptr<Resolution> dep_resolution(_resolution_for_resolvent(*r, true));
+ const std::tr1::shared_ptr<ConstraintSequence> constraints(_make_constraints_from_dependency(our_resolvent, *s, reason));
for (ConstraintSequence::ConstIterator c(constraints->begin()), c_end(constraints->end()) ;
c != c_end ; ++c)
- _apply_resolution_constraint(*qpn_s, dep_resolution, *c);
+ _apply_resolution_constraint(*r, dep_resolution, *c);
}
}
}
bool
-Resolver::_care_about_dependency_spec(const QPN_S & qpn_s,
+Resolver::_care_about_dependency_spec(const Resolvent & resolvent,
const std::tr1::shared_ptr<const Resolution> & resolution, const SanitisedDependency & dep) const
{
- return _imp->fns.care_about_dep_fn()(qpn_s, resolution, dep);
+ return _imp->fns.care_about_dep_fn()(resolvent, resolution, dep);
}
namespace
@@ -721,7 +723,7 @@ Resolver::_resolve_arrows()
{
Context context("When creating arrows for order resolution:");
- for (ResolutionsByQPN_SMap::iterator i(_imp->resolutions_by_qpn_s.begin()), i_end(_imp->resolutions_by_qpn_s.end()) ;
+ for (ResolutionsByResolventMap::iterator i(_imp->resolutions_by_resolvent.begin()), i_end(_imp->resolutions_by_resolvent.end()) ;
i != i_end ; ++i)
for (Constraints::ConstIterator c(i->second->constraints()->begin()),
c_end(i->second->constraints()->end()) ;
@@ -731,7 +733,7 @@ Resolver::_resolve_arrows()
void
Resolver::_resolve_arrow(
- const QPN_S & qpn_s,
+ const Resolvent & resolvent,
const std::tr1::shared_ptr<Resolution> &,
const std::tr1::shared_ptr<const Constraint> & constraint)
{
@@ -740,16 +742,16 @@ Resolver::_resolve_arrow(
if (! if_dependency_reason)
return;
- const QPN_S from_qpns(if_dependency_reason->from_id());
- const std::tr1::shared_ptr<Resolution> resolution(_resolution_for_qpn_s(from_qpns, false));
+ const Resolvent from_resolvent(if_dependency_reason->from_resolvent());
+ const std::tr1::shared_ptr<Resolution> resolution(_resolution_for_resolvent(from_resolvent, false));
if (constraint->spec().if_block())
{
if (constraint->spec().if_block()->strong())
{
resolution->arrows()->push_back(make_shared_ptr(new Arrow(make_named_values<Arrow>(
- value_for<n::ignorable_pass>(0),
- value_for<n::to_qpn_s>(qpn_s)
+ value_for<n::comes_after>(resolvent),
+ value_for<n::ignorable_pass>(0)
))));
}
}
@@ -765,8 +767,8 @@ Resolver::_resolve_arrow(
ignorable_pass = 2;
resolution->arrows()->push_back(make_shared_ptr(new Arrow(make_named_values<Arrow>(
- value_for<n::ignorable_pass>(ignorable_pass),
- value_for<n::to_qpn_s>(qpn_s)
+ value_for<n::comes_after>(resolvent),
+ value_for<n::ignorable_pass>(ignorable_pass)
))));
}
}
@@ -798,7 +800,7 @@ Resolver::_resolve_order()
bool done(false);
- for (ResolutionsByQPN_SMap::iterator i(_imp->resolutions_by_qpn_s.begin()), i_end(_imp->resolutions_by_qpn_s.end()) ;
+ for (ResolutionsByResolventMap::iterator i(_imp->resolutions_by_resolvent.begin()), i_end(_imp->resolutions_by_resolvent.end()) ;
i != i_end ; ++i)
{
switch (i->second->decision()->kind())
@@ -837,7 +839,7 @@ Resolver::_resolve_order()
int ignore_pass(0);
while (true)
{
- for (ResolutionsByQPN_SMap::iterator i(_imp->resolutions_by_qpn_s.begin()), i_end(_imp->resolutions_by_qpn_s.end()) ;
+ for (ResolutionsByResolventMap::iterator i(_imp->resolutions_by_resolvent.begin()), i_end(_imp->resolutions_by_resolvent.end()) ;
i != i_end ; ++i)
{
if (i->second->already_ordered())
@@ -876,7 +878,7 @@ Resolver::_resolve_order()
}
bool
-Resolver::_can_order_now(const QPN_S &, const std::tr1::shared_ptr<const Resolution> & resolution,
+Resolver::_can_order_now(const Resolvent &, const std::tr1::shared_ptr<const Resolution> & resolution,
const int ignorable_pass) const
{
for (ArrowSequence::ConstIterator a(resolution->arrows()->begin()), a_end(resolution->arrows()->end()) ;
@@ -886,7 +888,7 @@ Resolver::_can_order_now(const QPN_S &, const std::tr1::shared_ptr<const Resolut
if ((*a)->ignorable_pass() <= ignorable_pass)
continue;
- const std::tr1::shared_ptr<const Resolution> dep_resolution(_resolution_for_qpn_s((*a)->to_qpn_s()));
+ const std::tr1::shared_ptr<const Resolution> dep_resolution(_resolution_for_resolvent((*a)->comes_after()));
if (! dep_resolution->already_ordered())
return false;
}
@@ -895,7 +897,7 @@ Resolver::_can_order_now(const QPN_S &, const std::tr1::shared_ptr<const Resolut
}
void
-Resolver::_do_order(const QPN_S &, const std::tr1::shared_ptr<Resolution> & resolution)
+Resolver::_do_order(const Resolvent &, const std::tr1::shared_ptr<Resolution> & resolution)
{
_imp->resolution_lists->ordered()->append(resolution);
resolution->already_ordered() = true;
@@ -906,8 +908,7 @@ Resolver::_unable_to_order_more() const
{
std::cout << "Unable to order any of the following:" << std::endl;
- for (ResolutionsByQPN_SMap::const_iterator i(_imp->resolutions_by_qpn_s.begin()),
- i_end(_imp->resolutions_by_qpn_s.end()) ;
+ for (ResolutionsByResolventMap::const_iterator i(_imp->resolutions_by_resolvent.begin()), i_end(_imp->resolutions_by_resolvent.end()) ;
i != i_end ; ++i)
{
if (i->second->already_ordered())
@@ -922,28 +923,28 @@ Resolver::_unable_to_order_more() const
}
const std::tr1::shared_ptr<Constraints>
-Resolver::_initial_constraints_for(const QPN_S & qpn_s) const
+Resolver::_initial_constraints_for(const Resolvent & r) const
{
- return _imp->fns.get_initial_constraints_for_fn()(qpn_s);
+ return _imp->fns.get_initial_constraints_for_fn()(r);
}
-Resolver::ResolutionsByQPN_SConstIterator
-Resolver::begin_resolutions_by_qpn_s() const
+Resolver::ResolutionsByResolventConstIterator
+Resolver::begin_resolutions_by_resolvent() const
{
- return ResolutionsByQPN_SConstIterator(_imp->resolutions_by_qpn_s.begin());
+ return ResolutionsByResolventConstIterator(_imp->resolutions_by_resolvent.begin());
}
-Resolver::ResolutionsByQPN_SConstIterator
-Resolver::end_resolutions_by_qpn_s() const
+Resolver::ResolutionsByResolventConstIterator
+Resolver::end_resolutions_by_resolvent() const
{
- return ResolutionsByQPN_SConstIterator(_imp->resolutions_by_qpn_s.end());
+ return ResolutionsByResolventConstIterator(_imp->resolutions_by_resolvent.end());
}
int
-Resolver::find_any_score(const QPN_S & our_qpn_s, const SanitisedDependency & dep) const
+Resolver::find_any_score(const Resolvent & our_resolvent, const SanitisedDependency & dep) const
{
Context context("When working out whether we'd like '" + stringify(dep.spec()) + "' because of '"
- + stringify(our_qpn_s) + "':");
+ + stringify(our_resolvent) + "':");
if (dep.spec().if_block())
throw InternalError(PALUDIS_HERE, "unimplemented: blockers inside || blocks are horrid");
@@ -1031,31 +1032,31 @@ Resolver::find_any_score(const QPN_S & our_qpn_s, const SanitisedDependency & de
}
const std::tr1::shared_ptr<DependencyReason> reason(new DependencyReason(
- _resolution_for_qpn_s(our_qpn_s)->decision()->if_package_id(), dep));
- const std::tr1::shared_ptr<const QPN_S_Sequence> qpn_s_s(_get_qpn_s_s_for(spec, reason));
+ _resolution_for_resolvent(our_resolvent)->decision()->if_package_id(), our_resolvent, dep));
+ const std::tr1::shared_ptr<const Resolvents> resolvents(_get_resolvents_for(spec, reason));
/* next: will already be installing */
{
- for (QPN_S_Sequence::ConstIterator qpn_s(qpn_s_s->begin()), qpn_s_end(qpn_s_s->end()) ;
- qpn_s != qpn_s_end ; ++qpn_s)
+ for (Resolvents::ConstIterator r(resolvents->begin()), r_end(resolvents->end()) ;
+ r != r_end ; ++r)
{
- ResolutionsByQPN_SMap::const_iterator i(_imp->resolutions_by_qpn_s.find(*qpn_s));
- if (i != _imp->resolutions_by_qpn_s.end())
+ ResolutionsByResolventMap::const_iterator i(_imp->resolutions_by_resolvent.find(*r));
+ if (i != _imp->resolutions_by_resolvent.end())
return 30 + operator_bias;
}
}
/* next: could install */
{
- for (QPN_S_Sequence::ConstIterator qpn_s(qpn_s_s->begin()), qpn_s_end(qpn_s_s->end()) ;
- qpn_s != qpn_s_end ; ++qpn_s)
+ for (Resolvents::ConstIterator r(resolvents->begin()), r_end(resolvents->end()) ;
+ r != r_end ; ++r)
{
- const std::tr1::shared_ptr<Resolution> resolution(_create_resolution_for_qpn_s(*qpn_s));
- const std::tr1::shared_ptr<ConstraintSequence> constraints(_make_constraints_from_dependency(our_qpn_s, dep, reason));
+ const std::tr1::shared_ptr<Resolution> resolution(_create_resolution_for_resolvent(*r));
+ const std::tr1::shared_ptr<ConstraintSequence> constraints(_make_constraints_from_dependency(our_resolvent, dep, reason));
for (ConstraintSequence::ConstIterator c(constraints->begin()), c_end(constraints->end()) ;
c != c_end ; ++c)
resolution->constraints()->add(*c);
- const std::tr1::shared_ptr<Decision> decision(_try_to_find_decision_for(*qpn_s, resolution));
+ const std::tr1::shared_ptr<Decision> decision(_try_to_find_decision_for(*r, resolution));
if (decision)
return 20 + operator_bias;
}
@@ -1075,12 +1076,12 @@ Resolver::find_any_score(const QPN_S & our_qpn_s, const SanitisedDependency & de
}
const std::string
-Resolver::_find_cycle(const QPN_S & start_qpn_s, const int ignorable_pass) const
+Resolver::_find_cycle(const Resolvent & start_resolvent, const int ignorable_pass) const
{
std::stringstream result;
- std::set<QPN_S> seen;
- QPN_S current(start_qpn_s);
+ std::set<Resolvent> seen;
+ Resolvent current(start_resolvent);
bool first(true);
while (true)
@@ -1095,19 +1096,19 @@ Resolver::_find_cycle(const QPN_S & start_qpn_s, const int ignorable_pass) const
break;
bool ok(false);
- const std::tr1::shared_ptr<const Resolution> resolution(_resolution_for_qpn_s(current));
+ const std::tr1::shared_ptr<const Resolution> resolution(_resolution_for_resolvent(current));
for (ArrowSequence::ConstIterator a(resolution->arrows()->begin()), a_end(resolution->arrows()->end()) ;
a != a_end ; ++a)
{
if (_can_order_now(current, resolution, ignorable_pass))
continue;
- const std::tr1::shared_ptr<const Resolution> to_resolution(_resolution_for_qpn_s((*a)->to_qpn_s()));
+ const std::tr1::shared_ptr<const Resolution> to_resolution(_resolution_for_resolvent((*a)->comes_after()));
if (to_resolution->already_ordered())
continue;
ok = true;
- current = (*a)->to_qpn_s();
+ current = (*a)->comes_after();
break;
}
@@ -1139,8 +1140,8 @@ namespace
};
}
-const std::tr1::shared_ptr<const QPN_S_Sequence>
-Resolver::_get_qpn_s_s_for_blocker(const BlockDepSpec & spec) const
+const std::tr1::shared_ptr<const Resolvents>
+Resolver::_get_resolvents_for_blocker(const BlockDepSpec & spec) const
{
Context context("When finding slots for '" + stringify(spec) + "':");
@@ -1151,9 +1152,14 @@ Resolver::_get_qpn_s_s_for_blocker(const BlockDepSpec & spec) const
exact_slot = spec.blocking().slot_requirement_ptr()->accept_returning<std::tr1::shared_ptr<SlotName> >(f);
}
- std::tr1::shared_ptr<QPN_S_Sequence> result(new QPN_S_Sequence);
+ DestinationTypes destination_types(_get_destination_types_for_blocker(spec));
+ std::tr1::shared_ptr<Resolvents> result(new Resolvents);
if (exact_slot)
- result->push_back(QPN_S(spec.blocking(), exact_slot));
+ {
+ for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
+ if (destination_types[*t])
+ result->push_back(Resolvent(spec.blocking(), exact_slot, *t));
+ }
else
{
const std::tr1::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::BestVersionInEachSlot(
@@ -1161,14 +1167,22 @@ Resolver::_get_qpn_s_s_for_blocker(const BlockDepSpec & spec) const
)]);
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
- result->push_back(QPN_S(*i));
+ for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
+ if (destination_types[*t])
+ result->push_back(Resolvent(*i, *t));
}
return result;
}
-const std::tr1::shared_ptr<QPN_S_Sequence>
-Resolver::_get_qpn_s_s_for(
+const DestinationTypes
+Resolver::_get_destination_types_for_blocker(const BlockDepSpec &) const
+{
+ return DestinationTypes() + dt_slash;
+}
+
+const std::tr1::shared_ptr<const Resolvents>
+Resolver::_get_resolvents_for(
const PackageDepSpec & spec,
const std::tr1::shared_ptr<const Reason> & reason) const
{
@@ -1184,33 +1198,45 @@ Resolver::_get_qpn_s_s_for(
if (exact_slot)
{
- std::tr1::shared_ptr<QPN_S_Sequence> result(new QPN_S_Sequence);
- result->push_back(QPN_S(spec, exact_slot));
+ std::tr1::shared_ptr<Resolvents> result(new Resolvents);
+ DestinationTypes destination_types(_get_destination_types_for(spec, reason));
+ for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
+ if (destination_types[*t])
+ result->push_back(Resolvent(spec, exact_slot, *t));
return result;
}
else
- return _imp->fns.get_qpn_s_s_for_fn()(spec, reason);
+ return _imp->fns.get_resolvents_for_fn()(spec, reason);
+}
+
+const DestinationTypes
+Resolver::_get_destination_types_for(const PackageDepSpec &, const std::tr1::shared_ptr<const Reason> &) const
+{
+ return DestinationTypes() + dt_slash;
}
-const std::tr1::shared_ptr<QPN_S_Sequence>
-Resolver::_get_error_qpn_s_s_for(
+const std::tr1::shared_ptr<const Resolvents>
+Resolver::_get_error_resolvents_for(
const PackageDepSpec & spec,
- const std::tr1::shared_ptr<const Reason> &) const
+ const std::tr1::shared_ptr<const Reason> & reason) const
{
Context context("When finding slots for '" + stringify(spec) + "', which can't be found the normal way:");
- std::tr1::shared_ptr<QPN_S_Sequence> result(new QPN_S_Sequence);
- result->push_back(QPN_S(spec, make_null_shared_ptr()));
+ std::tr1::shared_ptr<Resolvents> result(new Resolvents);
+ DestinationTypes destination_types(_get_destination_types_for(spec, reason));
+ for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
+ if (destination_types[*t])
+ result->push_back(Resolvent(spec, make_null_shared_ptr(), *t));
return result;
}
const std::tr1::shared_ptr<Decision>
Resolver::_try_to_find_decision_for(
- const QPN_S & qpn_s,
+ const Resolvent & resolvent,
const std::tr1::shared_ptr<const Resolution> & resolution) const
{
- const std::tr1::shared_ptr<const PackageID> existing_id(_find_existing_id_for(qpn_s, resolution));
- std::pair<const std::tr1::shared_ptr<const PackageID>, bool> installable_id_best(_find_installable_id_for(qpn_s, resolution));
+ const std::tr1::shared_ptr<const PackageID> existing_id(_find_existing_id_for(resolvent, resolution));
+ std::pair<const std::tr1::shared_ptr<const PackageID>, bool> installable_id_best(_find_installable_id_for(resolvent, resolution));
const std::tr1::shared_ptr<const PackageID> installable_id(installable_id_best.first);
bool best(installable_id_best.second);
@@ -1218,6 +1244,7 @@ Resolver::_try_to_find_decision_for(
{
/* nothing existing, but nothing's ok */
return make_shared_ptr(new Decision(make_named_values<Decision>(
+ value_for<n::destination>(make_null_shared_ptr()),
value_for<n::if_package_id>(make_null_shared_ptr()),
value_for<n::is_best>(false),
value_for<n::is_same>(false),
@@ -1231,6 +1258,7 @@ Resolver::_try_to_find_decision_for(
{
/* there's nothing suitable existing. */
return make_shared_ptr(new Decision(make_named_values<Decision>(
+ value_for<n::destination>(make_null_shared_ptr()),
value_for<n::if_package_id>(installable_id),
value_for<n::is_best>(best),
value_for<n::is_same>(false),
@@ -1265,6 +1293,7 @@ Resolver::_try_to_find_decision_for(
}
return make_shared_ptr(new Decision(make_named_values<Decision>(
+ value_for<n::destination>(make_null_shared_ptr()),
value_for<n::if_package_id>(existing_id),
value_for<n::is_best>(false),
value_for<n::is_same>(true),
@@ -1342,6 +1371,7 @@ Resolver::_try_to_find_decision_for(
case ue_only_if_transient:
case ue_never:
return make_shared_ptr(new Decision(make_named_values<Decision>(
+ value_for<n::destination>(make_null_shared_ptr()),
value_for<n::if_package_id>(installable_id),
value_for<n::is_best>(best),
value_for<n::is_same>(is_same),
@@ -1354,6 +1384,7 @@ Resolver::_try_to_find_decision_for(
case ue_if_same:
if (is_same)
return make_shared_ptr(new Decision(make_named_values<Decision>(
+ value_for<n::destination>(make_null_shared_ptr()),
value_for<n::if_package_id>(existing_id),
value_for<n::is_best>(false),
value_for<n::is_same>(is_same),
@@ -1364,6 +1395,7 @@ Resolver::_try_to_find_decision_for(
)));
else
return make_shared_ptr(new Decision(make_named_values<Decision>(
+ value_for<n::destination>(make_null_shared_ptr()),
value_for<n::if_package_id>(installable_id),
value_for<n::is_best>(best),
value_for<n::is_same>(is_same),
@@ -1376,6 +1408,7 @@ Resolver::_try_to_find_decision_for(
case ue_if_same_version:
if (is_same_version)
return make_shared_ptr(new Decision(make_named_values<Decision>(
+ value_for<n::destination>(make_null_shared_ptr()),
value_for<n::if_package_id>(existing_id),
value_for<n::is_best>(false),
value_for<n::is_same>(is_same),
@@ -1386,6 +1419,7 @@ Resolver::_try_to_find_decision_for(
)));
else
return make_shared_ptr(new Decision(make_named_values<Decision>(
+ value_for<n::destination>(make_null_shared_ptr()),
value_for<n::if_package_id>(installable_id),
value_for<n::is_best>(best),
value_for<n::is_same>(is_same),
@@ -1397,6 +1431,7 @@ Resolver::_try_to_find_decision_for(
case ue_if_possible:
return make_shared_ptr(new Decision(make_named_values<Decision>(
+ value_for<n::destination>(make_null_shared_ptr()),
value_for<n::if_package_id>(existing_id),
value_for<n::is_best>(false),
value_for<n::is_same>(is_same),
@@ -1416,10 +1451,11 @@ Resolver::_try_to_find_decision_for(
const std::tr1::shared_ptr<Decision>
Resolver::_cannot_decide_for(
- const QPN_S &,
+ const Resolvent &,
const std::tr1::shared_ptr<const Resolution> & resolution) const
{
return make_shared_ptr(new Decision(make_named_values<Decision>(
+ value_for<n::destination>(make_null_shared_ptr()),
value_for<n::if_package_id>(make_null_shared_ptr()),
value_for<n::is_best>(false),
value_for<n::is_same>(false),
@@ -1431,33 +1467,33 @@ Resolver::_cannot_decide_for(
}
const std::tr1::shared_ptr<const PackageID>
-Resolver::_find_existing_id_for(const QPN_S & qpn_s, const std::tr1::shared_ptr<const Resolution> & resolution) const
+Resolver::_find_existing_id_for(const Resolvent & resolvent, const std::tr1::shared_ptr<const Resolution> & resolution) const
{
const std::tr1::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::AllVersionsSorted(
- generator::Package(qpn_s.package()) |
- qpn_s.make_slot_filter() |
+ generator::Package(resolvent.package()) |
+ make_slot_filter(resolvent) |
filter::InstalledAtRoot(FSEntry("/"))
)]);
- return _find_id_for_from(qpn_s, resolution, ids).first;
+ return _find_id_for_from(resolvent, resolution, ids).first;
}
const std::pair<const std::tr1::shared_ptr<const PackageID>, bool>
-Resolver::_find_installable_id_for(const QPN_S & qpn_s, const std::tr1::shared_ptr<const Resolution> & resolution) const
+Resolver::_find_installable_id_for(const Resolvent & resolvent, const std::tr1::shared_ptr<const Resolution> & resolution) const
{
const std::tr1::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::AllVersionsSorted(
- generator::Package(qpn_s.package()) |
- qpn_s.make_slot_filter() |
+ generator::Package(resolvent.package()) |
+ make_slot_filter(resolvent) |
filter::SupportsAction<InstallAction>() |
filter::NotMasked()
)]);
- return _find_id_for_from(qpn_s, resolution, ids);
+ return _find_id_for_from(resolvent, resolution, ids);
}
const std::pair<const std::tr1::shared_ptr<const PackageID>, bool>
Resolver::_find_id_for_from(
- const QPN_S &, const std::tr1::shared_ptr<const Resolution> & resolution,
+ const Resolvent &, const std::tr1::shared_ptr<const Resolution> & resolution,
const std::tr1::shared_ptr<const PackageIDSequence> & ids) const
{
bool best(true);
@@ -1494,7 +1530,7 @@ Resolver::resolution_lists() const
}
const std::tr1::shared_ptr<DependencySpecTree>
-Resolver::rewrite_if_special(const PackageOrBlockDepSpec & s, const QPN_S & our_qpn_s) const
+Resolver::rewrite_if_special(const PackageOrBlockDepSpec & s, const Resolvent & our_resolvent) const
{
if (s.if_package() && s.if_package()->package_ptr())
{
@@ -1528,7 +1564,7 @@ Resolver::rewrite_if_special(const PackageOrBlockDepSpec & s, const QPN_S & our_
for (std::set<QualifiedPackageName>::const_iterator n(r->second.begin()), n_end(r->second.end()) ;
n != n_end ; ++n)
{
- if (*n == our_qpn_s.package())
+ if (*n == our_resolvent.package())
continue;
PackageDepSpec spec(PartiallyMadePackageDepSpec(s.if_block()->blocking()).package(*n));
@@ -1569,6 +1605,6 @@ Resolver::_need_rewrites() const
#endif
}
-template class WrappedForwardIterator<Resolver::ResolutionsByQPN_SConstIteratorTag,
- const std::pair<const QPN_S, std::tr1::shared_ptr<Resolution> > >;
+template class WrappedForwardIterator<Resolver::ResolutionsByResolventConstIteratorTag,
+ const std::pair<const Resolvent, std::tr1::shared_ptr<Resolution> > >;
diff --git a/paludis/resolver/resolver.hh b/paludis/resolver/resolver.hh
index 530dd0e..c8fdea9 100644
--- a/paludis/resolver/resolver.hh
+++ b/paludis/resolver/resolver.hh
@@ -22,16 +22,16 @@
#include <paludis/resolver/resolver-fwd.hh>
#include <paludis/resolver/resolution-fwd.hh>
-#include <paludis/resolver/qpn_s-fwd.hh>
+#include <paludis/resolver/resolvent-fwd.hh>
#include <paludis/resolver/constraint-fwd.hh>
#include <paludis/resolver/sanitised_dependencies-fwd.hh>
#include <paludis/resolver/decision-fwd.hh>
#include <paludis/resolver/reason-fwd.hh>
#include <paludis/resolver/use_existing-fwd.hh>
-#include <paludis/resolver/destinations-fwd.hh>
#include <paludis/resolver/resolutions-fwd.hh>
#include <paludis/resolver/resolver_functions-fwd.hh>
#include <paludis/resolver/destination_types-fwd.hh>
+#include <paludis/resolver/destination-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/package_id-fwd.hh>
@@ -50,62 +50,62 @@ namespace paludis
private PrivateImplementationPattern<Resolver>
{
private:
- const std::tr1::shared_ptr<Resolution> _create_resolution_for_qpn_s(const QPN_S &) const;
- const std::tr1::shared_ptr<Resolution> _resolution_for_qpn_s(const QPN_S &, const bool create);
- const std::tr1::shared_ptr<Resolution> _resolution_for_qpn_s(const QPN_S &) const;
+ const std::tr1::shared_ptr<Resolution> _create_resolution_for_resolvent(const Resolvent &) const;
+ const std::tr1::shared_ptr<Resolution> _resolution_for_resolvent(const Resolvent &, const bool create);
+ const std::tr1::shared_ptr<Resolution> _resolution_for_resolvent(const Resolvent &) const;
- const std::tr1::shared_ptr<const QPN_S_Sequence> _get_qpn_s_s_for_blocker(const BlockDepSpec &) const;
+ const std::tr1::shared_ptr<const Resolvents> _get_resolvents_for_blocker(const BlockDepSpec &) const;
- const std::tr1::shared_ptr<QPN_S_Sequence> _get_qpn_s_s_for(
- const PackageDepSpec & spec,
- const std::tr1::shared_ptr<const Reason> & reason) const;
+ const DestinationTypes _get_destination_types_for_blocker(const BlockDepSpec &) const;
+
+ const std::tr1::shared_ptr<const Resolvents> _get_resolvents_for(
+ const PackageDepSpec & spec,
+ const std::tr1::shared_ptr<const Reason> & reason) const;
+
+ const DestinationTypes _get_destination_types_for(
+ const PackageDepSpec & spec,
+ const std::tr1::shared_ptr<const Reason> & reason) const;
- const std::tr1::shared_ptr<QPN_S_Sequence> _get_error_qpn_s_s_for(
+ const std::tr1::shared_ptr<const Resolvents> _get_error_resolvents_for(
const PackageDepSpec & spec,
const std::tr1::shared_ptr<const Reason> & reason) const;
const std::tr1::shared_ptr<ConstraintSequence> _make_constraints_from_target(
- const QPN_S &,
+ const Resolvent &,
const PackageDepSpec &,
const std::tr1::shared_ptr<const Reason> &) const;
const std::tr1::shared_ptr<ConstraintSequence> _make_constraints_from_dependency(
- const QPN_S &, const SanitisedDependency &,
+ const Resolvent &, const SanitisedDependency &,
const std::tr1::shared_ptr<const Reason> &) const;
- void _apply_resolution_constraint(const QPN_S &,
+ void _apply_resolution_constraint(const Resolvent &,
const std::tr1::shared_ptr<Resolution> &,
const std::tr1::shared_ptr<const Constraint> &);
- bool _verify_new_constraint(const QPN_S &,
+ bool _verify_new_constraint(const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const std::tr1::shared_ptr<const Constraint> &);
- void _made_wrong_decision(const QPN_S & qpn_s,
+ void _made_wrong_decision(const Resolvent &,
const std::tr1::shared_ptr<Resolution> & resolution,
const std::tr1::shared_ptr<const Constraint> & constraint);
- void _suggest_restart_with(const QPN_S & qpn_s,
+ void _suggest_restart_with(const Resolvent &,
const std::tr1::shared_ptr<const Resolution> & resolution,
const std::tr1::shared_ptr<const Constraint> & constraint,
const std::tr1::shared_ptr<const Decision> & decision) const PALUDIS_ATTRIBUTE((noreturn));
const std::tr1::shared_ptr<const Constraint> _make_constraint_for_preloading(
- const QPN_S & qpn_s,
+ const Resolvent &,
const std::tr1::shared_ptr<const Decision> & d,
const DestinationType t) const;
- const std::tr1::shared_ptr<Destinations> _make_destinations_for(const QPN_S &,
- const std::tr1::shared_ptr<const Resolution> &) const;
-
- const std::tr1::shared_ptr<Destination> _make_slash_destination_for(const QPN_S &,
- const std::tr1::shared_ptr<const Resolution> &) const;
-
const std::tr1::shared_ptr<const PackageIDSequence> _find_replacing(
const std::tr1::shared_ptr<const PackageID> &,
const std::tr1::shared_ptr<const Repository> &) const;
- void _resolve_arrow(const QPN_S &, const std::tr1::shared_ptr<Resolution> &,
+ void _resolve_arrow(const Resolvent &, const std::tr1::shared_ptr<Resolution> &,
const std::tr1::shared_ptr<const Constraint> &);
void _resolve_decide_with_dependencies();
@@ -113,43 +113,52 @@ namespace paludis
void _resolve_arrows();
void _resolve_order();
- void _decide(const QPN_S &, const std::tr1::shared_ptr<Resolution> & resolution);
+ const std::tr1::shared_ptr<Destination> _make_destination_for(
+ const Resolvent & resolvent,
+ const std::tr1::shared_ptr<const Resolution> & resolution) const;
+
+ const std::tr1::shared_ptr<Destination> _make_slash_destination_for(
+ const Resolvent & resolvent,
+ const std::tr1::shared_ptr<const Resolution> & resolution) const;
+
+ void _decide(const Resolvent &, const std::tr1::shared_ptr<Resolution> & resolution);
const std::tr1::shared_ptr<Decision> _try_to_find_decision_for(
- const QPN_S &, const std::tr1::shared_ptr<const Resolution> & resolution) const;
+ const Resolvent &, const std::tr1::shared_ptr<const Resolution> & resolution) const;
const std::tr1::shared_ptr<Decision> _cannot_decide_for(
- const QPN_S &, const std::tr1::shared_ptr<const Resolution> & resolution) const;
+ const Resolvent &, const std::tr1::shared_ptr<const Resolution> & resolution) const;
- void _add_dependencies(const QPN_S & our_qpn_s, const std::tr1::shared_ptr<Resolution> & our_resolution);
+ void _add_dependencies(const Resolvent & our_resolvent,
+ const std::tr1::shared_ptr<Resolution> & our_resolution);
- bool _care_about_dependency_spec(const QPN_S &, const std::tr1::shared_ptr<const Resolution> &,
+ bool _care_about_dependency_spec(const Resolvent &, const std::tr1::shared_ptr<const Resolution> &,
const SanitisedDependency &) const;
bool _causes_pre_arrow(const DependencyReason &) const;
- bool _can_order_now(const QPN_S &, const std::tr1::shared_ptr<const Resolution> & resolution,
+ bool _can_order_now(const Resolvent &, const std::tr1::shared_ptr<const Resolution> & resolution,
const int ignorable_pass) const;
- void _do_order(const QPN_S &, const std::tr1::shared_ptr<Resolution> & resolution);
+ void _do_order(const Resolvent &, const std::tr1::shared_ptr<Resolution> & resolution);
void _unable_to_order_more() const PALUDIS_ATTRIBUTE((noreturn));
- const std::tr1::shared_ptr<Constraints> _initial_constraints_for(const QPN_S &) const;
+ const std::tr1::shared_ptr<Constraints> _initial_constraints_for(const Resolvent &) const;
bool _same_slot(const std::tr1::shared_ptr<const PackageID> & a,
const std::tr1::shared_ptr<const PackageID> & b) const;
bool _already_met(const SanitisedDependency & dep) const;
- const std::string _find_cycle(const QPN_S &, const int ignorable_pass) const;
+ const std::string _find_cycle(const Resolvent &, const int ignorable_pass) const;
const std::tr1::shared_ptr<const PackageID> _find_existing_id_for(
- const QPN_S &, const std::tr1::shared_ptr<const Resolution> &) const;
+ const Resolvent &, const std::tr1::shared_ptr<const Resolution> &) const;
const std::pair<const std::tr1::shared_ptr<const PackageID>, bool> _find_installable_id_for(
- const QPN_S &, const std::tr1::shared_ptr<const Resolution> &) const;
+ const Resolvent &, const std::tr1::shared_ptr<const Resolution> &) const;
const std::pair<const std::tr1::shared_ptr<const PackageID>, bool> _find_id_for_from(
- const QPN_S &, const std::tr1::shared_ptr<const Resolution> &,
+ const Resolvent &, const std::tr1::shared_ptr<const Resolution> &,
const std::tr1::shared_ptr<const PackageIDSequence> &) const;
void _need_rewrites() const;
@@ -168,16 +177,19 @@ namespace paludis
const std::tr1::shared_ptr<const ResolutionLists> resolution_lists() const PALUDIS_ATTRIBUTE((warn_unused_result));
- struct ResolutionsByQPN_SConstIteratorTag;
- typedef WrappedForwardIterator<ResolutionsByQPN_SConstIteratorTag,
- const std::pair<const QPN_S, std::tr1::shared_ptr<Resolution> > > ResolutionsByQPN_SConstIterator;
- ResolutionsByQPN_SConstIterator begin_resolutions_by_qpn_s() const PALUDIS_ATTRIBUTE((warn_unused_result));
- ResolutionsByQPN_SConstIterator end_resolutions_by_qpn_s() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ struct ResolutionsByResolventConstIteratorTag;
+ typedef WrappedForwardIterator<ResolutionsByResolventConstIteratorTag,
+ const std::pair<const Resolvent, std::tr1::shared_ptr<Resolution> > >
+ ResolutionsByResolventConstIterator;
+ ResolutionsByResolventConstIterator begin_resolutions_by_resolvent() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+ ResolutionsByResolventConstIterator end_resolutions_by_resolvent() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- int find_any_score(const QPN_S &, const SanitisedDependency &) const;
+ int find_any_score(const Resolvent &, const SanitisedDependency &) const;
const std::tr1::shared_ptr<DependencySpecTree> rewrite_if_special(const PackageOrBlockDepSpec &,
- const QPN_S & from_qpn_s) const;
+ const Resolvent & from) const;
};
}
}
diff --git a/paludis/resolver/resolver_TEST_blockers.cc b/paludis/resolver/resolver_TEST_blockers.cc
index 3482831..3f53739 100644
--- a/paludis/resolver/resolver_TEST_blockers.cc
+++ b/paludis/resolver/resolver_TEST_blockers.cc
@@ -23,7 +23,7 @@
#include <paludis/resolver/decision.hh>
#include <paludis/resolver/resolutions.hh>
#include <paludis/resolver/constraint.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/suggest_restart.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
diff --git a/paludis/resolver/resolver_TEST_serialisation.cc b/paludis/resolver/resolver_TEST_serialisation.cc
index 8c0f4b5..1ec6c48 100644
--- a/paludis/resolver/resolver_TEST_serialisation.cc
+++ b/paludis/resolver/resolver_TEST_serialisation.cc
@@ -23,7 +23,7 @@
#include <paludis/resolver/decision.hh>
#include <paludis/resolver/resolutions.hh>
#include <paludis/resolver/constraint.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/suggest_restart.hh>
#include <paludis/resolver/serialise.hh>
#include <paludis/environments/test/test_environment.hh>
diff --git a/paludis/resolver/resolver_TEST_suggestions.cc b/paludis/resolver/resolver_TEST_suggestions.cc
index e6d662b..ef5e976 100644
--- a/paludis/resolver/resolver_TEST_suggestions.cc
+++ b/paludis/resolver/resolver_TEST_suggestions.cc
@@ -23,7 +23,7 @@
#include <paludis/resolver/decision.hh>
#include <paludis/resolver/resolutions.hh>
#include <paludis/resolver/constraint.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/suggest_restart.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
diff --git a/paludis/resolver/resolver_TEST_virtuals.cc b/paludis/resolver/resolver_TEST_virtuals.cc
index d8d1ce8..3bd4ae6 100644
--- a/paludis/resolver/resolver_TEST_virtuals.cc
+++ b/paludis/resolver/resolver_TEST_virtuals.cc
@@ -23,7 +23,7 @@
#include <paludis/resolver/decision.hh>
#include <paludis/resolver/resolutions.hh>
#include <paludis/resolver/constraint.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/suggest_restart.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
diff --git a/paludis/resolver/resolver_functions.hh b/paludis/resolver/resolver_functions.hh
index e8a16e0..5b81d99 100644
--- a/paludis/resolver/resolver_functions.hh
+++ b/paludis/resolver/resolver_functions.hh
@@ -23,7 +23,7 @@
#include <paludis/resolver/resolver_functions-fwd.hh>
#include <paludis/resolver/use_existing-fwd.hh>
#include <paludis/resolver/resolution-fwd.hh>
-#include <paludis/resolver/qpn_s-fwd.hh>
+#include <paludis/resolver/resolvent-fwd.hh>
#include <paludis/resolver/reason-fwd.hh>
#include <paludis/util/named_value.hh>
#include <tr1/functional>
@@ -34,7 +34,7 @@ namespace paludis
{
struct care_about_dep_fn;
struct get_initial_constraints_for_fn;
- struct get_qpn_s_s_for_fn;
+ struct get_resolvents_for_fn;
struct get_use_existing_fn;
struct take_dependency_fn;
}
@@ -42,28 +42,28 @@ namespace paludis
namespace resolver
{
typedef std::tr1::function<bool (
- const QPN_S &,
+ const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const SanitisedDependency &
)> CareAboutDepFunction;
typedef std::tr1::function<std::tr1::shared_ptr<Constraints> (
- const QPN_S &
+ const Resolvent &
)> GetInitialConstraintsFunction;
- typedef std::tr1::function<std::tr1::shared_ptr<QPN_S_Sequence> (
+ typedef std::tr1::function<std::tr1::shared_ptr<Resolvents> (
const PackageDepSpec &,
const std::tr1::shared_ptr<const Reason> &
- )> GetQPNSSForFunction;
+ )> GetResolventsForFunction;
typedef std::tr1::function<bool (
- const QPN_S &,
+ const Resolvent &,
const SanitisedDependency &,
const std::tr1::shared_ptr<const Reason> &
)> TakeDependencyFunction;
typedef std::tr1::function<UseExisting (
- const QPN_S &,
+ const Resolvent &,
const PackageDepSpec &,
const std::tr1::shared_ptr<const Reason> &
)> GetUseExistingFunction;
@@ -72,7 +72,7 @@ namespace paludis
{
NamedValue<n::care_about_dep_fn, CareAboutDepFunction> care_about_dep_fn;
NamedValue<n::get_initial_constraints_for_fn, GetInitialConstraintsFunction> get_initial_constraints_for_fn;
- NamedValue<n::get_qpn_s_s_for_fn, GetQPNSSForFunction> get_qpn_s_s_for_fn;
+ NamedValue<n::get_resolvents_for_fn, GetResolventsForFunction> get_resolvents_for_fn;
NamedValue<n::get_use_existing_fn, GetUseExistingFunction> get_use_existing_fn;
NamedValue<n::take_dependency_fn, TakeDependencyFunction> take_dependency_fn;
};
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index 58018c1..8978ac9 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -19,7 +19,7 @@
#include <paludis/resolver/resolver_test.hh>
#include <paludis/resolver/constraint.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/resolver.hh>
#include <paludis/resolver/resolution.hh>
#include <paludis/resolver/resolutions.hh>
@@ -58,7 +58,7 @@ paludis::resolver::resolver_test::from_keys(const std::tr1::shared_ptr<const Map
}
bool
-paludis::resolver::resolver_test::care_about_dep_fn(const QPN_S &, const std::tr1::shared_ptr<const Resolution> &, const SanitisedDependency &)
+paludis::resolver::resolver_test::care_about_dep_fn(const Resolvent &, const std::tr1::shared_ptr<const Resolution> &, const SanitisedDependency &)
{
return true;
}
@@ -66,21 +66,21 @@ paludis::resolver::resolver_test::care_about_dep_fn(const QPN_S &, const std::tr
const std::tr1::shared_ptr<Constraints>
paludis::resolver::resolver_test::initial_constraints_for_fn(
const InitialConstraints & initial_constraints,
- const QPN_S & qpn_s)
+ const Resolvent & resolvent)
{
- InitialConstraints::const_iterator i(initial_constraints.find(qpn_s));
+ InitialConstraints::const_iterator i(initial_constraints.find(resolvent));
if (i == initial_constraints.end())
return make_shared_ptr(new Constraints);
else
return i->second;
}
-std::tr1::shared_ptr<QPN_S_Sequence>
-paludis::resolver::resolver_test::get_qpn_s_s_for_fn(const PackageDepSpec & spec,
+std::tr1::shared_ptr<Resolvents>
+paludis::resolver::resolver_test::get_resolvents_for_fn(const PackageDepSpec & spec,
const std::tr1::shared_ptr<const Reason> &)
{
- std::tr1::shared_ptr<QPN_S_Sequence> result(new QPN_S_Sequence);
- result->push_back(QPN_S(spec, make_shared_ptr(new SlotName("0"))));
+ std::tr1::shared_ptr<Resolvents> result(new Resolvents);
+ result->push_back(Resolvent(spec, make_shared_ptr(new SlotName("0")), dt_slash));
return result;
}
@@ -148,7 +148,7 @@ paludis::resolver::resolver_test::is_suggestion(const SanitisedDependency & dep)
bool
paludis::resolver::resolver_test::take_dependency_fn(
- const QPN_S &,
+ const Resolvent &,
const SanitisedDependency & dep,
const std::tr1::shared_ptr<const Reason> &)
{
@@ -157,7 +157,7 @@ paludis::resolver::resolver_test::take_dependency_fn(
UseExisting
paludis::resolver::resolver_test::get_use_existing_fn(
- const QPN_S &,
+ const Resolvent &,
const PackageDepSpec &,
const std::tr1::shared_ptr<const Reason> &)
{
@@ -216,7 +216,7 @@ ResolverTestCase::get_resolutions(const PackageDepSpec & target)
value_for<n::get_initial_constraints_for_fn>(
std::tr1::bind(&initial_constraints_for_fn, std::tr1::ref(initial_constraints),
std::tr1::placeholders::_1)),
- value_for<n::get_qpn_s_s_for_fn>(&get_qpn_s_s_for_fn),
+ value_for<n::get_resolvents_for_fn>(&get_resolvents_for_fn),
value_for<n::get_use_existing_fn>(&get_use_existing_fn),
value_for<n::take_dependency_fn>(&take_dependency_fn)
));
@@ -226,7 +226,7 @@ ResolverTestCase::get_resolutions(const PackageDepSpec & target)
}
catch (const SuggestRestart & e)
{
- initial_constraints.insert(std::make_pair(e.qpn_s(), make_shared_ptr(new Constraints))).first->second->add(e.suggested_preset());
+ initial_constraints.insert(std::make_pair(e.resolvent(), make_shared_ptr(new Constraints))).first->second->add(e.suggested_preset());
}
}
}
@@ -254,7 +254,7 @@ ResolverTestCase::ResolutionListChecks::check_kind(const DecisionKind k,
if ((! r) || (! r->decision()))
return false;
- return r->decision()->kind() == k && r->qpn_s().package() == q;
+ return r->decision()->kind() == k && r->resolvent().package() == q;
}
std::string
@@ -264,10 +264,10 @@ ResolverTestCase::ResolutionListChecks::check_kind_msg(const DecisionKind k,
if (! r)
return "Expected " + stringify(k) + " " + stringify(q) + " but got finished";
else if (! r->decision())
- return "Expected " + stringify(k) + " " + stringify(q) + " but got undecided for " + stringify(r->qpn_s());
+ return "Expected " + stringify(k) + " " + stringify(q) + " but got undecided for " + stringify(r->resolvent());
else
return "Expected " + stringify(k) + " " + stringify(q) + " but got " + stringify(r->decision()->kind()) + " "
- + stringify(r->qpn_s().package());
+ + stringify(r->resolvent().package());
}
std::string
@@ -276,13 +276,13 @@ ResolverTestCase::ResolutionListChecks::check_generic_msg(const std::string & q,
if (! r)
return "Expected " + stringify(q) + " but got finished";
else if (! r->decision())
- return "Expected " + stringify(q) + " but got undecided for " + stringify(r->qpn_s());
+ return "Expected " + stringify(q) + " but got undecided for " + stringify(r->resolvent());
else if (! r->decision()->if_package_id())
return "Expected " + stringify(q) + " but got decided nothing (kind " + stringify(r->decision()->kind()) + ") for "
- + stringify(r->qpn_s());
+ + stringify(r->resolvent());
else
return "Expected " + stringify(q) + " but got " + stringify(r->decision()->if_package_id()->name()) + " for "
- + stringify(r->qpn_s());
+ + stringify(r->resolvent());
}
std::string
diff --git a/paludis/resolver/resolver_test.hh b/paludis/resolver/resolver_test.hh
index 1e773df..e1c659f 100644
--- a/paludis/resolver/resolver_test.hh
+++ b/paludis/resolver/resolver_test.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_RESOLVER_TEST_HH
#define PALUDIS_GUARD_PALUDIS_RESOLVER_RESOLVER_TEST_HH 1
-#include <paludis/resolver/qpn_s-fwd.hh>
+#include <paludis/resolver/resolvent-fwd.hh>
#include <paludis/resolver/constraint-fwd.hh>
#include <paludis/resolver/resolution-fwd.hh>
#include <paludis/resolver/sanitised_dependencies-fwd.hh>
@@ -47,26 +47,26 @@ namespace paludis
std::string from_keys(const std::tr1::shared_ptr<const Map<std::string, std::string> > & m,
const std::string & k);
- typedef std::map<QPN_S, std::tr1::shared_ptr<Constraints> > InitialConstraints;
+ typedef std::map<Resolvent, std::tr1::shared_ptr<Constraints> > InitialConstraints;
- bool care_about_dep_fn(const QPN_S &, const std::tr1::shared_ptr<const Resolution> &, const SanitisedDependency &);
+ bool care_about_dep_fn(const Resolvent &, const std::tr1::shared_ptr<const Resolution> &, const SanitisedDependency &);
const std::tr1::shared_ptr<Constraints> initial_constraints_for_fn(
const InitialConstraints & initial_constraints,
- const QPN_S & qpn_s);
+ const Resolvent & resolvent);
- std::tr1::shared_ptr<QPN_S_Sequence> get_qpn_s_s_for_fn(const PackageDepSpec & spec,
+ std::tr1::shared_ptr<Resolvents> get_resolvents_for_fn(const PackageDepSpec & spec,
const std::tr1::shared_ptr<const Reason> &);
bool is_suggestion(const SanitisedDependency & dep);
bool take_dependency_fn(
- const QPN_S &,
+ const Resolvent &,
const SanitisedDependency & dep,
const std::tr1::shared_ptr<const Reason> &);
UseExisting get_use_existing_fn(
- const QPN_S &,
+ const Resolvent &,
const PackageDepSpec &,
const std::tr1::shared_ptr<const Reason> &);
diff --git a/paludis/resolver/sanitised_dependencies.cc b/paludis/resolver/sanitised_dependencies.cc
index 868cf8c..fb9f745 100644
--- a/paludis/resolver/sanitised_dependencies.cc
+++ b/paludis/resolver/sanitised_dependencies.cc
@@ -19,7 +19,7 @@
#include <paludis/resolver/sanitised_dependencies.hh>
#include <paludis/resolver/resolver.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/serialise-impl.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/save.hh>
@@ -98,7 +98,7 @@ namespace
struct AnyDepSpecChildHandler
{
const Resolver & resolver;
- const QPN_S our_qpn_s;
+ const Resolvent our_resolvent;
const std::tr1::function<SanitisedDependency (const PackageOrBlockDepSpec &)> parent_make_sanitised;
bool super_complicated, nested;
@@ -108,10 +108,10 @@ namespace
bool seen_any;
- AnyDepSpecChildHandler(const Resolver & r, const QPN_S & q,
+ AnyDepSpecChildHandler(const Resolver & r, const Resolvent & q,
const std::tr1::function<SanitisedDependency (const PackageOrBlockDepSpec &)> & f) :
resolver(r),
- our_qpn_s(q),
+ our_resolvent(q),
parent_make_sanitised(f),
super_complicated(false),
nested(false),
@@ -124,7 +124,7 @@ namespace
{
seen_any = true;
- std::tr1::shared_ptr<DependencySpecTree> if_rewritten(resolver.rewrite_if_special(spec, our_qpn_s));
+ std::tr1::shared_ptr<DependencySpecTree> if_rewritten(resolver.rewrite_if_special(spec, our_resolvent));
if (if_rewritten)
if_rewritten->root()->accept(*this);
else
@@ -199,7 +199,7 @@ namespace
void visit(const DependencySpecTree::NodeType<AnyDepSpec>::Type & node)
{
- AnyDepSpecChildHandler h(resolver, our_qpn_s, parent_make_sanitised);
+ AnyDepSpecChildHandler h(resolver, our_resolvent, parent_make_sanitised);
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(h));
std::list<SanitisedDependency> l;
h.commit(
@@ -261,7 +261,7 @@ namespace
for (std::list<PackageOrBlockDepSpec>::const_iterator h(g->begin()), h_end(g->end()) ;
h != h_end ; ++h)
{
- int score(resolver.find_any_score(our_qpn_s, make_sanitised(PackageOrBlockDepSpec(*h))));
+ int score(resolver.find_any_score(our_resolvent, make_sanitised(PackageOrBlockDepSpec(*h))));
if ((-1 == worst_score) || (score < worst_score))
worst_score = score;
}
@@ -285,7 +285,7 @@ namespace
struct Finder
{
const Resolver & resolver;
- const QPN_S our_qpn_s;
+ const Resolvent our_resolvent;
SanitisedDependencies & sanitised_dependencies;
const std::string raw_name;
const std::string human_name;
@@ -294,14 +294,14 @@ namespace
Finder(
const Resolver & r,
- const QPN_S & q,
+ const Resolvent & q,
SanitisedDependencies & s,
const std::tr1::shared_ptr<const DependencyLabelSequence> & l,
const std::string & rn,
const std::string & hn,
const std::string & a) :
resolver(r),
- our_qpn_s(q),
+ our_resolvent(q),
sanitised_dependencies(s),
raw_name(rn),
human_name(hn),
@@ -313,7 +313,7 @@ namespace
void add(const SanitisedDependency & dep)
{
- std::tr1::shared_ptr<DependencySpecTree> if_rewritten(resolver.rewrite_if_special(dep.spec(), our_qpn_s));
+ std::tr1::shared_ptr<DependencySpecTree> if_rewritten(resolver.rewrite_if_special(dep.spec(), our_resolvent));
if (if_rewritten)
if_rewritten->root()->accept(*this);
else
@@ -390,7 +390,7 @@ namespace
original_specs_as_string = "|| (" + v.result + " )";
}
- AnyDepSpecChildHandler h(resolver, our_qpn_s, std::tr1::bind(&Finder::make_sanitised, this, std::tr1::placeholders::_1));
+ AnyDepSpecChildHandler h(resolver, our_resolvent, std::tr1::bind(&Finder::make_sanitised, this, std::tr1::placeholders::_1));
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(h));
h.commit(
std::tr1::bind(&Finder::make_sanitised, this, std::tr1::placeholders::_1),
@@ -431,13 +431,14 @@ SanitisedDependencies::~SanitisedDependencies()
void
SanitisedDependencies::_populate_one(
const Resolver & resolver,
+ const Resolvent & resolvent,
const std::tr1::shared_ptr<const PackageID> & id,
const std::tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > (PackageID::* const pmf) () const
)
{
Context context("When finding dependencies for '" + stringify(*id) + "' from key '" + ((*id).*pmf)()->raw_name() + "':");
- Finder f(resolver, QPN_S(id), *this, ((*id).*pmf)()->initial_labels(), ((*id).*pmf)()->raw_name(),
+ Finder f(resolver, resolvent, *this, ((*id).*pmf)()->initial_labels(), ((*id).*pmf)()->raw_name(),
((*id).*pmf)()->human_name(), "");
((*id).*pmf)()->value()->root()->accept(f);
}
@@ -445,22 +446,23 @@ SanitisedDependencies::_populate_one(
void
SanitisedDependencies::populate(
const Resolver & resolver,
+ const Resolvent & resolvent,
const std::tr1::shared_ptr<const PackageID> & id)
{
Context context("When finding dependencies for '" + stringify(*id) + "':");
if (id->dependencies_key())
- _populate_one(resolver, id, &PackageID::dependencies_key);
+ _populate_one(resolver, resolvent, id, &PackageID::dependencies_key);
else
{
if (id->build_dependencies_key())
- _populate_one(resolver, id, &PackageID::build_dependencies_key);
+ _populate_one(resolver, resolvent, id, &PackageID::build_dependencies_key);
if (id->run_dependencies_key())
- _populate_one(resolver, id, &PackageID::run_dependencies_key);
+ _populate_one(resolver, resolvent, id, &PackageID::run_dependencies_key);
if (id->post_dependencies_key())
- _populate_one(resolver, id, &PackageID::post_dependencies_key);
+ _populate_one(resolver, resolvent, id, &PackageID::post_dependencies_key);
if (id->suggested_dependencies_key())
- _populate_one(resolver, id, &PackageID::suggested_dependencies_key);
+ _populate_one(resolver, resolvent, id, &PackageID::suggested_dependencies_key);
}
}
diff --git a/paludis/resolver/sanitised_dependencies.hh b/paludis/resolver/sanitised_dependencies.hh
index d09ce2f..69cdad9 100644
--- a/paludis/resolver/sanitised_dependencies.hh
+++ b/paludis/resolver/sanitised_dependencies.hh
@@ -23,6 +23,7 @@
#include <paludis/resolver/sanitised_dependencies-fwd.hh>
#include <paludis/resolver/resolver-fwd.hh>
#include <paludis/resolver/serialise-fwd.hh>
+#include <paludis/resolver/resolvent-fwd.hh>
#include <paludis/util/named_value.hh>
#include <paludis/dep_label-fwd.hh>
#include <paludis/dep_spec.hh>
@@ -82,6 +83,7 @@ namespace paludis
private:
void _populate_one(
const Resolver &,
+ const Resolvent &,
const std::tr1::shared_ptr<const PackageID> &,
const std::tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > (PackageID::* const) () const
);
@@ -92,6 +94,7 @@ namespace paludis
void populate(
const Resolver &,
+ const Resolvent &,
const std::tr1::shared_ptr<const PackageID> &);
void add(const SanitisedDependency & d);
diff --git a/paludis/resolver/suggest_restart.cc b/paludis/resolver/suggest_restart.cc
index f147dae..45c7ac5 100644
--- a/paludis/resolver/suggest_restart.cc
+++ b/paludis/resolver/suggest_restart.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/resolver/suggest_restart.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/constraint.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
@@ -31,19 +31,19 @@ namespace paludis
template <>
struct Implementation<SuggestRestart>
{
- const QPN_S qpn_s;
+ const Resolvent resolvent;
const std::tr1::shared_ptr<const Decision> previous_decision;
const std::tr1::shared_ptr<const Constraint> problematic_constraint;
const std::tr1::shared_ptr<const Decision> new_decision;
const std::tr1::shared_ptr<const Constraint> suggested_preset;
- Implementation(const QPN_S & q,
+ Implementation(const Resolvent & q,
const std::tr1::shared_ptr<const Decision> & pd,
const std::tr1::shared_ptr<const Constraint> & pc,
const std::tr1::shared_ptr<const Decision> & nd,
const std::tr1::shared_ptr<const Constraint> & nc
) :
- qpn_s(q),
+ resolvent(q),
previous_decision(pd),
problematic_constraint(pc),
new_decision(nd),
@@ -53,7 +53,7 @@ namespace paludis
};
}
-SuggestRestart::SuggestRestart(const QPN_S & q,
+SuggestRestart::SuggestRestart(const Resolvent & q,
const std::tr1::shared_ptr<const Decision> & pd,
const std::tr1::shared_ptr<const Constraint> & pc,
const std::tr1::shared_ptr<const Decision> & nd,
@@ -65,7 +65,8 @@ SuggestRestart::SuggestRestart(const QPN_S & q,
}
SuggestRestart::SuggestRestart(const SuggestRestart & o) :
- PrivateImplementationPattern<SuggestRestart>(new Implementation<SuggestRestart>(o.qpn_s(), o.previous_decision(), o.problematic_constraint(),
+ PrivateImplementationPattern<SuggestRestart>(new Implementation<SuggestRestart>(
+ o.resolvent(), o.previous_decision(), o.problematic_constraint(),
o.new_decision(), o.suggested_preset())),
Exception(o)
{
@@ -75,10 +76,10 @@ SuggestRestart::~SuggestRestart() throw ()
{
}
-const QPN_S
-SuggestRestart::qpn_s() const
+const Resolvent
+SuggestRestart::resolvent() const
{
- return _imp->qpn_s;
+ return _imp->resolvent;
}
const std::tr1::shared_ptr<const Decision>
diff --git a/paludis/resolver/suggest_restart.hh b/paludis/resolver/suggest_restart.hh
index fe88781..8a5315c 100644
--- a/paludis/resolver/suggest_restart.hh
+++ b/paludis/resolver/suggest_restart.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_RESOLVER_SUGGEST_RESTART_HH 1
#include <paludis/resolver/suggest_restart-fwd.hh>
-#include <paludis/resolver/qpn_s-fwd.hh>
+#include <paludis/resolver/resolvent-fwd.hh>
#include <paludis/resolver/constraint-fwd.hh>
#include <paludis/resolver/decision-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
@@ -38,7 +38,7 @@ namespace paludis
{
public:
SuggestRestart(
- const QPN_S &,
+ const Resolvent &,
const std::tr1::shared_ptr<const Decision> & previous_decision,
const std::tr1::shared_ptr<const Constraint> & problematic_constraint,
const std::tr1::shared_ptr<const Decision> & new_decision,
@@ -46,7 +46,7 @@ namespace paludis
SuggestRestart(const SuggestRestart &);
~SuggestRestart() throw ();
- const QPN_S qpn_s() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const Resolvent resolvent() const PALUDIS_ATTRIBUTE((warn_unused_result));
const std::tr1::shared_ptr<const Decision> previous_decision() const PALUDIS_ATTRIBUTE((warn_unused_result));
const std::tr1::shared_ptr<const Constraint> problematic_constraint() const PALUDIS_ATTRIBUTE((warn_unused_result));
const std::tr1::shared_ptr<const Decision> new_decision() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 2a0b991..b10c768 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -40,10 +40,10 @@
#include <paludis/resolver/sanitised_dependencies.hh>
#include <paludis/resolver/resolution.hh>
#include <paludis/resolver/decision.hh>
-#include <paludis/resolver/destinations.hh>
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/resolver.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
+#include <paludis/resolver/destination.hh>
#include <paludis/package_id.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key.hh>
@@ -222,10 +222,10 @@ namespace
const std::tr1::shared_ptr<const Resolution> & resolution,
const bool verbose)
{
- if (resolution->qpn_s().slot_name_or_null())
- cout << "[?] " << c::bold_red() << resolution->qpn_s() << c::normal();
+ if (resolution->resolvent().slot_name_or_null())
+ cout << "[?] " << c::bold_red() << resolution->resolvent() << c::normal();
else
- cout << "[?] " << c::bold_red() << resolution->qpn_s().package() << c::normal();
+ cout << "[?] " << c::bold_red() << resolution->resolvent().package() << c::normal();
cout << " (no decision could be reached)" << endl;
display_reasons(resolution, verbose);
@@ -255,35 +255,32 @@ namespace
other_slots(false);
std::tr1::shared_ptr<const PackageID> old_id;
- if ((*c)->destinations()->by_type(dt_slash))
+ if ((*c)->decision()->destination()->replacing()->empty())
{
- if ((*c)->destinations()->by_type(dt_slash)->replacing()->empty())
+ is_new = true;
+ const std::tr1::shared_ptr<const PackageIDSequence> others((*env)[selection::SomeArbitraryVersion(
+ generator::Package(id->name()) &
+ generator::InRepository((*c)->decision()->destination()->repository())
+ )]);
+ other_slots = ! others->empty();
+ }
+ else
+ for (PackageIDSequence::ConstIterator x((*c)->decision()->destination()->replacing()->begin()),
+ x_end((*c)->decision()->destination()->replacing()->end()) ;
+ x != x_end ; ++x)
{
- is_new = true;
- const std::tr1::shared_ptr<const PackageIDSequence> others((*env)[selection::SomeArbitraryVersion(
- generator::Package(id->name()) &
- generator::InRepository((*c)->destinations()->by_type(dt_slash)->repository())
- )]);
- other_slots = ! others->empty();
+ old_id = *x;
+ if ((*x)->version() == id->version())
+ is_reinstall = true;
+ else if ((*x)->version() < id->version())
+ is_upgrade = true;
+ else if ((*x)->version() > id->version())
+ is_downgrade = true;
}
- else
- for (PackageIDSequence::ConstIterator x((*c)->destinations()->by_type(dt_slash)->replacing()->begin()),
- x_end((*c)->destinations()->by_type(dt_slash)->replacing()->end()) ;
- x != x_end ; ++x)
- {
- old_id = *x;
- if ((*x)->version() == id->version())
- is_reinstall = true;
- else if ((*x)->version() < id->version())
- is_upgrade = true;
- else if ((*x)->version() > id->version())
- is_downgrade = true;
- }
- /* pick the worst of what it is */
- is_upgrade = is_upgrade && (! is_reinstall) && (! is_downgrade);
- is_reinstall = is_reinstall && (! is_downgrade);
- }
+ /* pick the worst of what it is */
+ is_upgrade = is_upgrade && (! is_reinstall) && (! is_downgrade);
+ is_reinstall = is_reinstall && (! is_downgrade);
if (! (*c)->decision()->taken())
{
@@ -307,54 +304,51 @@ namespace
cout << c::normal() << " " << id->canonical_form(idcf_version);
- if ((*c)->destinations()->by_type(dt_slash))
+ cout << " to ::" << (*c)->decision()->destination()->repository();
+ if (! (*c)->decision()->destination()->replacing()->empty())
{
- cout << " to ::" << (*c)->destinations()->by_type(dt_slash)->repository();
- if (! (*c)->destinations()->by_type(dt_slash)->replacing()->empty())
+ cout << " replacing";
+ bool first(true);
+ for (PackageIDSequence::ConstIterator x((*c)->decision()->destination()->replacing()->begin()),
+ x_end((*c)->decision()->destination()->replacing()->end()) ;
+ x != x_end ; ++x)
{
- cout << " replacing";
- bool first(true);
- for (PackageIDSequence::ConstIterator x((*c)->destinations()->by_type(dt_slash)->replacing()->begin()),
- x_end((*c)->destinations()->by_type(dt_slash)->replacing()->end()) ;
- x != x_end ; ++x)
+ bool different(false);
+ std::string old_from;
+ if ((*x)->from_repositories_key())
{
- bool different(false);
- std::string old_from;
- if ((*x)->from_repositories_key())
+ for (Set<std::string>::ConstIterator k((*x)->from_repositories_key()->value()->begin()),
+ k_end((*x)->from_repositories_key()->value()->end()) ;
+ k != k_end ; ++k)
{
- for (Set<std::string>::ConstIterator k((*x)->from_repositories_key()->value()->begin()),
- k_end((*x)->from_repositories_key()->value()->end()) ;
- k != k_end ; ++k)
+ if (stringify(id->repository()->name()) != *k)
{
- if (stringify(id->repository()->name()) != *k)
+ if (id->from_repositories_key() && (id->from_repositories_key()->value()->end() !=
+ id->from_repositories_key()->value()->find(*k)))
{
- if (id->from_repositories_key() && (id->from_repositories_key()->value()->end() !=
- id->from_repositories_key()->value()->find(*k)))
- {
- }
- else
- different = true;
}
-
- if (old_from.empty())
- old_from = " from ::";
else
- old_from.append(", ::");
-
- old_from.append(*k);
+ different = true;
}
- }
- if (! first)
- cout << ", ";
- else
- cout << " ";
- first = false;
+ if (old_from.empty())
+ old_from = " from ::";
+ else
+ old_from.append(", ::");
- cout << (*x)->canonical_form(idcf_version);
- if (different)
- cout << old_from;
+ old_from.append(*k);
+ }
}
+
+ if (! first)
+ cout << ", ";
+ else
+ cout << " ";
+ first = false;
+
+ cout << (*x)->canonical_form(idcf_version);
+ if (different)
+ cout << old_from;
}
}
@@ -572,11 +566,11 @@ namespace
)))
continue;
- if (spec.package_ptr() && *spec.package_ptr() != (*r)->qpn_s().package())
+ if (spec.package_ptr() && *spec.package_ptr() != (*r)->resolvent().package())
continue;
- if (spec.package_name_part_ptr() && *spec.package_name_part_ptr() != (*r)->qpn_s().package().package())
+ if (spec.package_name_part_ptr() && *spec.package_name_part_ptr() != (*r)->resolvent().package().package())
continue;
- if (spec.category_name_part_ptr() && *spec.category_name_part_ptr() != (*r)->qpn_s().package().category())
+ if (spec.category_name_part_ptr() && *spec.category_name_part_ptr() != (*r)->resolvent().package().category())
continue;
}
else
@@ -587,7 +581,7 @@ namespace
any = true;
- std::cout << "For " << (*r)->qpn_s() << ":" << std::endl;
+ std::cout << "For " << (*r)->resolvent() << ":" << std::endl;
std::cout << " The following constraints were in action:" << std::endl;
for (Constraints::ConstIterator c((*r)->constraints()->begin()),
c_end((*r)->constraints()->end()) ;
@@ -638,15 +632,12 @@ namespace
{
std::cout << " The decision made was:" << std::endl;
std::cout << " Use " << *(*r)->decision()->if_package_id() << std::endl;
- if ((*r)->destinations()->by_type(dt_slash))
- {
- std::cout << " Install to / using repository " << (*r)->destinations()->by_type(dt_slash)->repository() << std::endl;
- if (! (*r)->destinations()->by_type(dt_slash)->replacing()->empty())
- for (PackageIDSequence::ConstIterator x((*r)->destinations()->by_type(dt_slash)->replacing()->begin()),
- x_end((*r)->destinations()->by_type(dt_slash)->replacing()->end()) ;
- x != x_end ; ++x)
- std::cout << " Replacing " << **x << std::endl;
- }
+ std::cout << " Install to repository " << (*r)->decision()->destination()->repository() << std::endl;
+ if (! (*r)->decision()->destination()->replacing()->empty())
+ for (PackageIDSequence::ConstIterator x((*r)->decision()->destination()->replacing()->begin()),
+ x_end((*r)->decision()->destination()->replacing()->end()) ;
+ x != x_end ; ++x)
+ std::cout << " Replacing " << **x << std::endl;
std::cout << std::endl;
}
else
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 742661e..72d532d 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -38,10 +38,10 @@
#include <paludis/resolver/sanitised_dependencies.hh>
#include <paludis/resolver/resolution.hh>
#include <paludis/resolver/decision.hh>
-#include <paludis/resolver/destinations.hh>
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/resolver.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
+#include <paludis/resolver/destination.hh>
#include <paludis/package_id.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key.hh>
@@ -196,9 +196,9 @@ namespace
command.append(" install --hooks ");
command.append(stringify(id->uniquely_identifying_spec()));
- command.append(" --destination " + stringify(r->destinations()->by_type(dt_slash)->repository()));
- for (PackageIDSequence::ConstIterator i(r->destinations()->by_type(dt_slash)->replacing()->begin()),
- i_end(r->destinations()->by_type(dt_slash)->replacing()->end()) ;
+ command.append(" --destination " + stringify(r->decision()->destination()->repository()));
+ for (PackageIDSequence::ConstIterator i(r->decision()->destination()->replacing()->begin()),
+ i_end(r->decision()->destination()->replacing()->end()) ;
i != i_end ; ++i)
command.append(" --replacing " + stringify((*i)->uniquely_identifying_spec()));
@@ -291,7 +291,7 @@ namespace
if (0 != retcode)
return retcode;
- if ((*c)->destinations()->by_type(dt_slash))
+ if ((*c)->resolvent().destination_type() == dt_slash)
{
retcode = do_install_slash(env, cmdline, *c, x, y);
if (0 != retcode)
diff --git a/src/clients/cave/cmd_resolve.cc b/src/clients/cave/cmd_resolve.cc
index a0a38f1..3a8aa78 100644
--- a/src/clients/cave/cmd_resolve.cc
+++ b/src/clients/cave/cmd_resolve.cc
@@ -37,10 +37,9 @@
#include <paludis/resolver/resolver_functions.hh>
#include <paludis/resolver/reason.hh>
#include <paludis/resolver/suggest_restart.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/sanitised_dependencies.hh>
-#include <paludis/resolver/destinations.hh>
#include <paludis/resolver/serialise-impl.hh>
#include <paludis/resolver/resolutions.hh>
#include <paludis/user_dep_spec.hh>
@@ -68,6 +67,20 @@ using std::endl;
namespace
{
+ Filter make_destination_filter(const DestinationType t)
+ {
+ switch (t)
+ {
+ case dt_slash:
+ return filter::InstalledAtRoot(FSEntry("/"));
+
+ case last_dt:
+ break;
+ }
+
+ throw InternalError(PALUDIS_HERE, stringify(t));
+ }
+
void add_resolver_targets(
const std::tr1::shared_ptr<Environment> & env,
const std::tr1::shared_ptr<Resolver> & resolver,
@@ -155,7 +168,7 @@ namespace
};
UseExisting use_existing_fn(const ResolveCommandLine & cmdline,
- const QPN_S &,
+ const Resolvent &,
const PackageDepSpec &,
const std::tr1::shared_ptr<const Reason> & reason)
{
@@ -221,14 +234,15 @@ namespace
return false;
}
- bool installed_is_scm_older_than(const Environment * const env, const QPN_S & q, const int n)
+ bool installed_is_scm_older_than(const Environment * const env, const Resolvent & q, const int n)
{
Context context("When working out whether '" + stringify(q) + "' has installed SCM packages:");
const std::tr1::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsUnsorted(
generator::Package(q.package()) |
- q.make_slot_filter() |
- filter::InstalledAtRoot(FSEntry("/")))]);
+ make_slot_filter(q) |
+ make_destination_filter(q.destination_type())
+ )]);
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
@@ -240,23 +254,23 @@ namespace
return false;
}
- typedef std::map<QPN_S, std::tr1::shared_ptr<Constraints> > InitialConstraints;
+ typedef std::map<Resolvent, std::tr1::shared_ptr<Constraints> > InitialConstraints;
const std::tr1::shared_ptr<Constraints> make_initial_constraints_for(
const Environment * const env,
const ResolveCommandLine & cmdline,
- const QPN_S & qpn_s)
+ const Resolvent & resolvent)
{
const std::tr1::shared_ptr<Constraints> result(new Constraints);
int n(reinstall_scm_days(cmdline));
- if ((-1 != n) && installed_is_scm_older_than(env, qpn_s, n))
+ if ((-1 != n) && installed_is_scm_older_than(env, resolvent, n))
{
result->add(make_shared_ptr(new Constraint(make_named_values<Constraint>(
value_for<n::destination_type>(dt_slash),
value_for<n::nothing_is_fine_too>(false),
value_for<n::reason>(make_shared_ptr(new PresetReason)),
- value_for<n::spec>(make_package_dep_spec(PartiallyMadePackageDepSpecOptions()).package(qpn_s.package())),
+ value_for<n::spec>(make_package_dep_spec(PartiallyMadePackageDepSpecOptions()).package(resolvent.package())),
value_for<n::untaken>(false),
value_for<n::use_existing>(ue_only_if_transient)
))));
@@ -269,11 +283,11 @@ namespace
const Environment * const env,
const ResolveCommandLine & cmdline,
const InitialConstraints & initial_constraints,
- const QPN_S & qpn_s)
+ const Resolvent & resolvent)
{
- InitialConstraints::const_iterator i(initial_constraints.find(qpn_s));
+ InitialConstraints::const_iterator i(initial_constraints.find(resolvent));
if (i == initial_constraints.end())
- return make_initial_constraints_for(env, cmdline, qpn_s);
+ return make_initial_constraints_for(env, cmdline, resolvent);
else
return i->second;
}
@@ -307,15 +321,15 @@ namespace
return reason->accept_returning<bool>(v);
}
- const std::tr1::shared_ptr<QPN_S_Sequence>
- get_qpn_s_s_for_fn(const Environment * const env,
+ const std::tr1::shared_ptr<Resolvents>
+ get_resolvents_for_fn(const Environment * const env,
const ResolveCommandLine & cmdline,
const PackageDepSpec & spec,
const std::tr1::shared_ptr<const Reason> & reason)
{
- std::tr1::shared_ptr<QPN_S_Sequence> result(new QPN_S_Sequence);
- std::tr1::shared_ptr<QPN_S> best;
- std::list<QPN_S> installed;
+ std::tr1::shared_ptr<Resolvents> result(new Resolvents);
+ std::tr1::shared_ptr<Resolvent> best;
+ std::list<Resolvent> installed;
const std::tr1::shared_ptr<const PackageIDSequence> ids((*env)[selection::BestVersionOnly(
generator::Matches(spec, MatchPackageOptions() + mpo_ignore_additional_requirements) |
@@ -323,7 +337,7 @@ namespace
filter::NotMasked())]);
if (! ids->empty())
- best = make_shared_ptr(new QPN_S(*ids->begin()));
+ best = make_shared_ptr(new Resolvent(*ids->begin(), dt_slash));
const std::tr1::shared_ptr<const PackageIDSequence> installed_ids((*env)[selection::BestVersionInEachSlot(
generator::Matches(spec, MatchPackageOptions()) |
@@ -331,7 +345,7 @@ namespace
for (PackageIDSequence::ConstIterator i(installed_ids->begin()), i_end(installed_ids->end()) ;
i != i_end ; ++i)
- installed.push_back(QPN_S(*i));
+ installed.push_back(Resolvent(*i, dt_slash));
const args::EnumArg & arg(is_target(reason) ? cmdline.resolution_options.a_target_slots : cmdline.resolution_options.a_slots);
@@ -479,7 +493,7 @@ namespace
}
bool care_about_dep_fn(const Environment * const, const ResolveCommandLine & cmdline,
- const QPN_S &, const std::tr1::shared_ptr<const Resolution> & resolution,
+ const Resolvent &, const std::tr1::shared_ptr<const Resolution> & resolution,
const SanitisedDependency & dep)
{
if (dk_existing_no_change == resolution->decision()->kind())
@@ -504,7 +518,7 @@ namespace
bool
take_dependency_fn(const Environment * const,
const ResolveCommandLine &,
- const QPN_S &,
+ const Resolvent &,
const SanitisedDependency & dep,
const std::tr1::shared_ptr<const Reason> &)
{
@@ -681,7 +695,7 @@ ResolveCommand::run(
std::tr1::placeholders::_2, std::tr1::placeholders::_3)),
value_for<n::get_initial_constraints_for_fn>(std::tr1::bind(&initial_constraints_for_fn,
env.get(), std::tr1::cref(cmdline), std::tr1::cref(initial_constraints), std::tr1::placeholders::_1)),
- value_for<n::get_qpn_s_s_for_fn>(std::tr1::bind(&get_qpn_s_s_for_fn,
+ value_for<n::get_resolvents_for_fn>(std::tr1::bind(&get_resolvents_for_fn,
env.get(), std::tr1::cref(cmdline), std::tr1::placeholders::_1, std::tr1::placeholders::_2)),
value_for<n::get_use_existing_fn>(std::tr1::bind(&use_existing_fn,
std::tr1::cref(cmdline), std::tr1::placeholders::_1, std::tr1::placeholders::_2, std::tr1::placeholders::_3)),
@@ -708,8 +722,8 @@ ResolveCommand::run(
catch (const SuggestRestart & e)
{
display_callback(ResolverRestart());
- initial_constraints.insert(std::make_pair(e.qpn_s(), make_initial_constraints_for(
- env.get(), cmdline, e.qpn_s()))).first->second->add(
+ initial_constraints.insert(std::make_pair(e.resolvent(), make_initial_constraints_for(
+ env.get(), cmdline, e.resolvent()))).first->second->add(
e.suggested_preset());
resolver = make_shared_ptr(new Resolver(env.get(), resolver_functions));
}
diff --git a/src/clients/cave/cmd_resolve_dump.cc b/src/clients/cave/cmd_resolve_dump.cc
index 22a7e67..473fd82 100644
--- a/src/clients/cave/cmd_resolve_dump.cc
+++ b/src/clients/cave/cmd_resolve_dump.cc
@@ -19,14 +19,14 @@
#include "cmd_resolve_dump.hh"
#include <paludis/resolver/resolver.hh>
-#include <paludis/resolver/qpn_s.hh>
+#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/sanitised_dependencies.hh>
#include <paludis/resolver/resolution.hh>
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/decision.hh>
-#include <paludis/resolver/destinations.hh>
#include <paludis/resolver/reason.hh>
#include <paludis/resolver/arrow.hh>
+#include <paludis/resolver/destination.hh>
#include <paludis/util/enum_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/join.hh>
@@ -42,6 +42,20 @@ using namespace paludis::resolver;
namespace
{
std::ostream &
+ operator<< (std::ostream & s, const Destination & d)
+ {
+ std::stringstream ss;
+ ss << "Destination(" << d.repository();
+ if (! d.replacing()->empty())
+ ss << " replacing " << join(indirect_iterator(d.replacing()->begin()),
+ indirect_iterator(d.replacing()->end()), ", ");
+ ss << ")";
+
+ s << ss.str();
+ return s;
+ }
+
+ std::ostream &
operator<< (std::ostream & s, const Decision & d)
{
std::stringstream ss;
@@ -62,44 +76,9 @@ namespace
if (d.is_same_version())
ss << ", is same version";
- ss << ")";
-
- s << ss.str();
- return s;
- }
-
- std::ostream &
- operator<< (std::ostream & s, const Destination & d)
- {
- std::stringstream ss;
- ss << "Destination(" << d.repository();
- if (! d.replacing()->empty())
- ss << " replacing " << join(indirect_iterator(d.replacing()->begin()),
- indirect_iterator(d.replacing()->end()), ", ");
- ss << ")";
+ if (d.destination())
+ ss << " -> " << *d.destination();
- s << ss.str();
- return s;
- }
-
- std::ostream &
- operator<< (std::ostream & s, const Destinations & d)
- {
- std::stringstream ss;
- ss << "Destinations(";
- for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
- if (d.by_type(*t))
- {
- switch (*t)
- {
- case dt_slash:
- ss << "slash: " << *d.by_type(*t);
- break;
-
- case last_dt:
- break;
- }
- }
ss << ")";
s << ss.str();
@@ -194,7 +173,7 @@ namespace
std::ostream &
operator<< (std::ostream & s, const Arrow & a)
{
- s << "Arrow(-> " << a.to_qpn_s();
+ s << "Arrow(-> " << a.comes_after();
if (0 != a.ignorable_pass())
s << ", ignorable pass " << a.ignorable_pass();
s << ")";
@@ -231,12 +210,6 @@ namespace
<< "; arrows: " << join(indirect_iterator(r.arrows()->begin()),
indirect_iterator(r.arrows()->end()), ", ", stringify_arrow)
<< "; already_ordered: " << stringify(r.already_ordered()) << ")"
- << "; destinations: ";
- if (r.destinations())
- ss << *r.destinations();
- else
- ss << "unknown";
- ss
<< ")";
s << ss.str();
return s;
@@ -249,8 +222,8 @@ namespace
{
std::cout << "Dumping resolutions by QPN:S:" << std::endl << std::endl;
- for (Resolver::ResolutionsByQPN_SConstIterator c(resolver->begin_resolutions_by_qpn_s()),
- c_end(resolver->end_resolutions_by_qpn_s()) ;
+ for (Resolver::ResolutionsByResolventConstIterator c(resolver->begin_resolutions_by_resolvent()),
+ c_end(resolver->end_resolutions_by_resolvent()) ;
c != c_end ; ++c)
{
std::cout << c->first << std::endl;