aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-07 22:11:55 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-07 22:11:55 +0100
commit5aee8457e0ecc73e5c7f3b643f815b5237a6d972 (patch)
tree8e7e647bda618d815876e5cd4c6bbb89bbaa4e54
parent80636f271383ea34d5a3326af2472173958f8ed5 (diff)
downloadpaludis-5aee8457e0ecc73e5c7f3b643f815b5237a6d972.tar.gz
paludis-5aee8457e0ecc73e5c7f3b643f815b5237a6d972.tar.xz
change how we handle no qpn:s available
-rw-r--r--paludis/resolver/resolver.cc29
-rw-r--r--paludis/resolver/resolver.hh4
2 files changed, 25 insertions, 8 deletions
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index fe3ca88..f8d3b63 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -262,9 +262,9 @@ Resolver::add_target_with_reason(const PackageDepSpec & spec, const std::tr1::sh
_imp->env->trigger_notifier_callback(NotifierCallbackResolverStepEvent());
- const std::tr1::shared_ptr<const QPN_S_Sequence> qpn_s_s(_get_qpn_s_s_for(spec, reason));
+ std::tr1::shared_ptr<const QPN_S_Sequence> qpn_s_s(_get_qpn_s_s_for(spec, reason));
if (qpn_s_s->empty())
- throw InternalError(PALUDIS_HERE, "not implemented: no slot for " + stringify(spec));
+ qpn_s_s = _get_error_qpn_s_s_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)
@@ -570,14 +570,15 @@ Resolver::_add_dependencies(const QPN_S & our_qpn_s, const std::tr1::shared_ptr<
else
qpn_s_s = _get_qpn_s_s_for_blocker(*s->spec().if_block());
- if (qpn_s_s->empty() && s->spec().if_package())
+ if (qpn_s_s->empty())
{
- if (our_resolution->decision()->is_installed())
- Log::get_instance()->message("resolver.cannot_find_installed_dep", ll_warning, lc_context)
- << "Installed package '" << *our_resolution->decision()->if_package_id()
- << "' dependency '" << s->spec() << "' cannot be met";
+ if (s->spec().if_package())
+ qpn_s_s = _get_error_qpn_s_s_for(*s->spec().if_package(), reason);
else
- throw InternalError(PALUDIS_HERE, "not implemented: no slot for " + stringify(s->spec()));
+ {
+ /* 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()) ;
@@ -1130,6 +1131,18 @@ Resolver::_get_qpn_s_s_for(
return _imp->fns.get_qpn_s_s_for_fn()(spec, reason);
}
+const std::tr1::shared_ptr<QPN_S_Sequence>
+Resolver::_get_error_qpn_s_s_for(
+ const PackageDepSpec & spec,
+ const std::tr1::shared_ptr<const 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()));
+ return result;
+}
+
const std::tr1::shared_ptr<Decision>
Resolver::_try_to_find_decision_for(
const QPN_S & qpn_s,
diff --git a/paludis/resolver/resolver.hh b/paludis/resolver/resolver.hh
index 6cbbc46..37e3fd7 100644
--- a/paludis/resolver/resolver.hh
+++ b/paludis/resolver/resolver.hh
@@ -60,6 +60,10 @@ namespace paludis
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 PackageDepSpec & spec,
+ const std::tr1::shared_ptr<const Reason> & reason) const;
+
const std::tr1::shared_ptr<Constraint> _make_constraint_from_target(
const QPN_S &,
const PackageDepSpec &,