aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-23 15:55:41 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-23 15:55:41 +0100
commit6948b4d8ed0e48e7658c5f593e4940d2b9d00224 (patch)
tree13f3a93ccc8a821d3ecc45c944281d9696952acb
parent8d1870f26c4fe3b34fb90d252722338b90c70fc4 (diff)
downloadpaludis-6948b4d8ed0e48e7658c5f593e4940d2b9d00224.tar.gz
paludis-6948b4d8ed0e48e7658c5f593e4940d2b9d00224.tar.xz
--dump-restarts
-rw-r--r--src/clients/cave/cmd_resolve.cc36
-rw-r--r--src/clients/cave/cmd_resolve_cmdline.cc3
-rw-r--r--src/clients/cave/cmd_resolve_cmdline.hh1
3 files changed, 39 insertions, 1 deletions
diff --git a/src/clients/cave/cmd_resolve.cc b/src/clients/cave/cmd_resolve.cc
index 5deb4e6..5888d08 100644
--- a/src/clients/cave/cmd_resolve.cc
+++ b/src/clients/cave/cmd_resolve.cc
@@ -671,6 +671,36 @@ namespace
become_command(cmd);
}
+
+ void display_restarts_if_requested(const std::list<SuggestRestart> & restarts,
+ const ResolveCommandLine & cmdline)
+ {
+ if (! cmdline.resolution_options.a_dump_restarts.specified())
+ return;
+
+ std::cout << "Dumping restarts:" << std::endl << std::endl;
+
+ for (std::list<SuggestRestart>::const_iterator r(restarts.begin()), r_end(restarts.end()) ;
+ r != r_end ; ++r)
+ {
+ std::cout << "* " << r->resolvent() << std::endl;
+
+ std::cout << " Had decided upon ";
+ if (r->previous_decision()->if_package_id())
+ std::cout << *r->previous_decision()->if_package_id();
+ else
+ std::cout << r->previous_decision()->kind();
+ std::cout << std::endl;
+
+ std::cout << " Which did not satisfy " << r->problematic_constraint()->spec()
+ << ", use existing " << r->problematic_constraint()->use_existing();
+ if (r->problematic_constraint()->nothing_is_fine_too())
+ std::cout << ", nothing is fine too";
+ std::cout << std::endl;
+ }
+
+ std::cout << std::endl;
+ }
}
@@ -763,6 +793,8 @@ ResolveCommand::run(
std::tr1::shared_ptr<Resolver> resolver(new Resolver(env.get(), resolver_functions));
try
{
+ std::list<SuggestRestart> restarts;
+
{
DisplayCallback display_callback;
ScopedNotifierCallback display_callback_holder(env.get(),
@@ -778,6 +810,7 @@ ResolveCommand::run(
}
catch (const SuggestRestart & e)
{
+ restarts.push_back(e);
display_callback(ResolverRestart());
initial_constraints.insert(std::make_pair(e.resolvent(), make_initial_constraints_for(
env.get(), cmdline, e.resolvent()))).first->second->add(
@@ -787,6 +820,9 @@ ResolveCommand::run(
}
}
+ if (! restarts.empty())
+ display_restarts_if_requested(restarts, cmdline);
+
dump_if_requested(env, resolver, cmdline);
retcode |= display_resolution(env, *resolver->resolution_lists(), cmdline);
diff --git a/src/clients/cave/cmd_resolve_cmdline.cc b/src/clients/cave/cmd_resolve_cmdline.cc
index 7e5c5f5..1f5f48f 100644
--- a/src/clients/cave/cmd_resolve_cmdline.cc
+++ b/src/clients/cave/cmd_resolve_cmdline.cc
@@ -173,7 +173,8 @@ ResolveCommandLineResolutionOptions::ResolveCommandLineResolutionOptions(args::A
"error occurs. For debugging purposes; produces rather a lot of noise."),
a_dump(&g_dump_options, "dump", '\0', "Dump debug output", true),
a_dump_dependencies(&g_dump_options, "dump-dependencies", '\0', "If dumping, also dump the "
- "sanitised dependencies selected for every package" , true)
+ "sanitised dependencies selected for every package", true),
+ a_dump_restarts(&g_dump_options, "dump-restarts", '\0', "Dump restarts", true)
{
}
diff --git a/src/clients/cave/cmd_resolve_cmdline.hh b/src/clients/cave/cmd_resolve_cmdline.hh
index be42ddf..e29bf25 100644
--- a/src/clients/cave/cmd_resolve_cmdline.hh
+++ b/src/clients/cave/cmd_resolve_cmdline.hh
@@ -98,6 +98,7 @@ namespace paludis
args::ArgsGroup g_dump_options;
args::SwitchArg a_dump;
args::SwitchArg a_dump_dependencies;
+ args::SwitchArg a_dump_restarts;
};
struct ResolveCommandLineExecutionOptions :