aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-08-06 22:30:57 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-08-06 22:30:57 +0100
commit3b2d7e83d8735916d89a9bd61bdf9c92d77f016e (patch)
tree972c0d74f0cdc164705b2005a1ec8b7aee9c4137
parentdc07a4ad8233149f651e6e7530f18780269eb469 (diff)
downloadpaludis-3b2d7e83d8735916d89a9bd61bdf9c92d77f016e.tar.gz
paludis-3b2d7e83d8735916d89a9bd61bdf9c92d77f016e.tar.xz
error if no --explain match is found
-rw-r--r--src/clients/cave/cmd_resolve.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/clients/cave/cmd_resolve.cc b/src/clients/cave/cmd_resolve.cc
index aa121d3..700f2ad 100644
--- a/src/clients/cave/cmd_resolve.cc
+++ b/src/clients/cave/cmd_resolve.cc
@@ -519,6 +519,7 @@ namespace
for (args::StringSetArg::ConstIterator i(cmdline.a_explain.begin_args()), i_end(cmdline.a_explain.end_args()) ;
i != i_end ; ++i)
{
+ bool any(false);
PackageDepSpec spec(parse_user_package_dep_spec(*i, env.get(), UserPackageDepSpecOptions() + updso_allow_wildcards));
for (Resolver::ResolutionsByQPN_SConstIterator r(resolver->begin_resolutions_by_qpn_s()),
r_end(resolver->end_resolutions_by_qpn_s()) ;
@@ -527,6 +528,8 @@ namespace
if (! match_package(*env, spec, *r->second->decision()->package_id(), MatchPackageOptions()))
continue;
+ any = true;
+
std::cout << "For " << r->first << ":" << std::endl;
std::cout << " The following constraints were in action:" << std::endl;
for (Constraints::ConstIterator c(r->second->constraints()->begin()),
@@ -578,6 +581,9 @@ namespace
}
std::cout << std::endl;
}
+
+ if (! any)
+ throw args::DoHelp("There is nothing matching '" + *i + "' in the resolution set.");
}
}