aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-06 18:24:53 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-06 18:24:53 +0000
commit232d4b35ebb34fe37c543f19fefe2c6c125c7f99 (patch)
treeb9e77dcf8eafb80c6b53dabc2e359e71007b3f0d
parent9dfecca9df5def7fab895e2909f4e05cf2d47892 (diff)
downloadpaludis-232d4b35ebb34fe37c543f19fefe2c6c125c7f99.tar.gz
paludis-232d4b35ebb34fe37c543f19fefe2c6c125c7f99.tar.xz
Show unmet requirements in detail
-rw-r--r--src/clients/cave/cmd_display_resolution.cc34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index a5a63f8..cc1d8b0 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 2009, 2010 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
@@ -619,6 +619,7 @@ namespace
}
void display_unable_to_make_decision(
+ const std::tr1::shared_ptr<Environment> & env,
const std::tr1::shared_ptr<const Resolution> & resolution,
const UnableToMakeDecision & d)
{
@@ -645,9 +646,26 @@ namespace
{
cout << " Did not meet ";
display_one_constraint(**c);
+
ReasonNameGetter g(false);
cout << " from " << (*c)->reason()->accept_returning<std::pair<std::string, bool> >(g).first;
cout << endl;
+
+ if ((*c)->spec().if_package() && (*c)->spec().if_package()->additional_requirements_ptr() &&
+ (! match_package(*env, *(*c)->spec().if_package(), *u->package_id(), MatchPackageOptions())) &&
+ match_package(*env, *(*c)->spec().if_package(), *u->package_id(), MatchPackageOptions() + mpo_ignore_additional_requirements))
+ {
+ for (AdditionalPackageDepSpecRequirements::ConstIterator a((*c)->spec().if_package()->additional_requirements_ptr()->begin()),
+ a_end((*c)->spec().if_package()->additional_requirements_ptr()->end()) ;
+ a != a_end ; ++a)
+ {
+ const std::pair<bool, std::string> p((*a)->requirement_met(env.get(), *u->package_id()));
+ if (p.first)
+ continue;
+
+ cout << " " << p.second << endl;
+ }
+ }
}
}
}
@@ -685,7 +703,7 @@ namespace
bool visit(const UnableToMakeDecision & d) const
{
- display_unable_to_make_decision(resolution, d);
+ display_unable_to_make_decision(env, resolution, d);
return true;
}
};
@@ -822,9 +840,13 @@ namespace
struct DisplayOneDecisionVisitor
{
+ const std::tr1::shared_ptr<Environment> env;
const std::tr1::shared_ptr<const Resolution> resolution;
- DisplayOneDecisionVisitor(const std::tr1::shared_ptr<const Resolution> & r) :
+ DisplayOneDecisionVisitor(
+ const std::tr1::shared_ptr<Environment> & e,
+ const std::tr1::shared_ptr<const Resolution> & r) :
+ env(e),
resolution(r)
{
}
@@ -846,17 +868,17 @@ namespace
void visit(const UnableToMakeDecision & d) const
{
- display_unable_to_make_decision(resolution, d);
+ display_unable_to_make_decision(env, resolution, d);
}
};
void display_one_decision(
- const std::tr1::shared_ptr<Environment> &,
+ const std::tr1::shared_ptr<Environment> & env,
const DisplayResolutionCommandLine &,
const std::tr1::shared_ptr<const Resolution> & resolution,
const Decision & decision)
{
- decision.accept(DisplayOneDecisionVisitor(resolution));
+ decision.accept(DisplayOneDecisionVisitor(env, resolution));
}
void display_errors(