aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-08-09 16:45:14 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-08-09 16:44:54 +0100
commit305a908ffacfbb06d471ac7eec43b8228d7a73f5 (patch)
tree81e084034a93909c527e9c487ae24f7db71f3e52
parent2a62e29b2bb38caed81b44cbafc331f3c11a7790 (diff)
downloadpaludis-305a908ffacfbb06d471ac7eec43b8228d7a73f5.tar.gz
paludis-305a908ffacfbb06d471ac7eec43b8228d7a73f5.tar.xz
track dep reason's owning id, not qpn:s
-rw-r--r--paludis/resolver/reason.cc19
-rw-r--r--paludis/resolver/reason.hh5
-rw-r--r--paludis/resolver/resolver.cc8
-rw-r--r--src/clients/cave/cmd_resolve.cc2
4 files changed, 19 insertions, 15 deletions
diff --git a/paludis/resolver/reason.cc b/paludis/resolver/reason.cc
index fcffb91..76b4e6b 100644
--- a/paludis/resolver/reason.cc
+++ b/paludis/resolver/reason.cc
@@ -48,19 +48,20 @@ namespace paludis
template <>
struct Implementation<DependencyReason>
{
- const QPN_S qpn_s;
+ const std::tr1::shared_ptr<const PackageID> from_id;
const SanitisedDependency dep;
- Implementation(const QPN_S & q, const SanitisedDependency & d) :
- qpn_s(q),
+ Implementation(const std::tr1::shared_ptr<const PackageID> & i, const SanitisedDependency & d) :
+ from_id(i),
dep(d)
{
}
};
}
-DependencyReason::DependencyReason(const QPN_S & q, const SanitisedDependency & d) :
- PrivateImplementationPattern<DependencyReason>(new Implementation<DependencyReason>(q, d))
+DependencyReason::DependencyReason(const std::tr1::shared_ptr<const PackageID> & i,
+ const SanitisedDependency & d) :
+ PrivateImplementationPattern<DependencyReason>(new Implementation<DependencyReason>(i, d))
{
}
@@ -68,10 +69,10 @@ DependencyReason::~DependencyReason()
{
}
-const QPN_S
-DependencyReason::qpn_s() const
+const std::tr1::shared_ptr<const PackageID>
+DependencyReason::from_id() const
{
- return _imp->qpn_s;
+ return _imp->from_id;
}
const SanitisedDependency &
@@ -83,7 +84,7 @@ DependencyReason::sanitised_dependency() const
std::string
DependencyReason::as_string() const
{
- return "Dependency(package: " + stringify(_imp->qpn_s) + " dep: " + stringify(_imp->dep) + ")";
+ return "Dependency(package: " + stringify(*_imp->from_id) + " dep: " + stringify(_imp->dep) + ")";
}
std::string
diff --git a/paludis/resolver/reason.hh b/paludis/resolver/reason.hh
index 0778800..d6cb177 100644
--- a/paludis/resolver/reason.hh
+++ b/paludis/resolver/reason.hh
@@ -27,6 +27,7 @@
#include <paludis/util/simple_visitor.hh>
#include <paludis/util/type_list.hh>
#include <paludis/name-fwd.hh>
+#include <paludis/package_id-fwd.hh>
#include <tr1/memory>
namespace paludis
@@ -57,12 +58,12 @@ namespace paludis
{
public:
DependencyReason(
- const QPN_S & q,
+ const std::tr1::shared_ptr<const PackageID> & id,
const SanitisedDependency & s);
~DependencyReason();
- const QPN_S qpn_s() const;
+ const std::tr1::shared_ptr<const PackageID> from_id() const;
const SanitisedDependency & sanitised_dependency() const;
virtual std::string as_string() const;
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index 88423df..f8d172d 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -572,7 +572,8 @@ Resolver::_add_dependencies(const QPN_S & our_qpn_s, const std::tr1::shared_ptr<
if (! _care_about_dependency_spec(our_qpn_s, our_resolution, *s))
continue;
- const std::tr1::shared_ptr<DependencyReason> reason(new DependencyReason(our_qpn_s, *s));
+ const std::tr1::shared_ptr<DependencyReason> reason(new DependencyReason(
+ our_resolution->decision()->if_package_id(), *s));
std::tr1::shared_ptr<const QPN_S_Sequence> qpn_s_s;
@@ -713,7 +714,7 @@ Resolver::_resolve_arrows()
if (! if_dependency_reason)
continue;
- const QPN_S from_qpns(if_dependency_reason->qpn_s());
+ const QPN_S from_qpns(if_dependency_reason->from_id());
const std::tr1::shared_ptr<Resolution> resolution(_resolution_for_qpn_s(from_qpns, false));
ArrowInfo a(*if_dependency_reason);
@@ -1118,7 +1119,8 @@ Resolver::find_any_score(const QPN_S & our_qpn_s, const SanitisedDependency & de
return 40 + operator_bias;
}
- const std::tr1::shared_ptr<DependencyReason> reason(new DependencyReason(our_qpn_s, dep));
+ 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(_imp->fns.get_qpn_s_s_for_fn()(spec, reason));
/* next: will already be installing */
diff --git a/src/clients/cave/cmd_resolve.cc b/src/clients/cave/cmd_resolve.cc
index ee3088e..896745f 100644
--- a/src/clients/cave/cmd_resolve.cc
+++ b/src/clients/cave/cmd_resolve.cc
@@ -494,7 +494,7 @@ namespace
void visit(const DependencyReason & reason)
{
- std::cout << "of dependency " << reason.sanitised_dependency() << " from " << reason.qpn_s();
+ std::cout << "of dependency " << reason.sanitised_dependency() << " from " << *reason.from_id();
}
void visit(const PresetReason &)