aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-14 19:11:14 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-14 19:11:14 +0100
commite555408334b6179a8a7cb5efa06f5d548cc58a68 (patch)
treee6db2ecacfa8484134a467d71e07254c8f3e5f65
parent3fec8404901a7b82928f4931a57af232417a1b99 (diff)
downloadpaludis-e555408334b6179a8a7cb5efa06f5d548cc58a68.tar.gz
paludis-e555408334b6179a8a7cb5efa06f5d548cc58a68.tar.xz
Use the new order for display-resolution
-rw-r--r--src/clients/cave/cmd_display_resolution.cc514
-rw-r--r--src/clients/cave/cmd_display_resolution.hh4
-rw-r--r--src/clients/cave/resolve_common.cc17
3 files changed, 211 insertions, 324 deletions
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 804eaca..b96f17b 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -54,7 +54,7 @@
#include <paludis/resolver/job.hh>
#include <paludis/resolver/jobs.hh>
#include <paludis/resolver/job_id.hh>
-#include <paludis/resolver/required_confirmations.hh>
+#include <paludis/resolver/decisions.hh>
#include <paludis/package_id.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key.hh>
@@ -398,7 +398,7 @@ namespace
void display_explanations(
const std::tr1::shared_ptr<Environment> & env,
- const ResolverLists & lists,
+ const std::tr1::shared_ptr<const Resolved> & resolved,
const DisplayResolutionCommandLine & cmdline)
{
Context context("When displaying explanations:");
@@ -414,8 +414,8 @@ namespace
{
bool any(false);
PackageDepSpec spec(parse_user_package_dep_spec(*i, env.get(), UserPackageDepSpecOptions() + updso_allow_wildcards));
- for (ResolutionsByResolvent::ConstIterator r(lists.resolutions_by_resolvent()->begin()),
- r_end(lists.resolutions_by_resolvent()->end()) ;
+ for (ResolutionsByResolvent::ConstIterator r(resolved->resolutions_by_resolvent()->begin()),
+ r_end(resolved->resolutions_by_resolvent()->end()) ;
r != r_end ; ++r)
{
if (! decision_matches_spec(env, (*r)->resolvent(), *(*r)->decision(), spec))
@@ -636,41 +636,39 @@ namespace
cout << endl;
}
- struct DisplayConfirmationVisitor
- {
- std::string visit(const DowngradeConfirmation &) const
- {
- return "--permit-downgrade";
- }
-
- std::string visit(const NotBestConfirmation &) const
- {
- return "--permit-old-version";
- }
- };
-
- std::string stringify_confirmation(const RequiredConfirmation & c)
- {
- return c.accept_returning<std::string>(DisplayConfirmationVisitor());
- }
-
- void display_confirmations(
- const Job & job)
- {
- const std::tr1::shared_ptr<const RequiredConfirmations> r(job.required_confirmations());
- if (! r->empty())
- cout << c::bold_red() << " Cannot proceed without: " << c::normal() <<
- join(indirect_iterator(r->begin()), indirect_iterator(r->end()), ", ", stringify_confirmation) << endl;
- }
+// struct DisplayConfirmationVisitor
+// {
+// std::string visit(const DowngradeConfirmation &) const
+// {
+// return "--permit-downgrade";
+// }
+//
+// std::string visit(const NotBestConfirmation &) const
+// {
+// return "--permit-old-version";
+// }
+// };
+//
+// std::string stringify_confirmation(const RequiredConfirmation & c)
+// {
+// return c.accept_returning<std::string>(DisplayConfirmationVisitor());
+// }
+//
+// void display_confirmations(
+// const Job & job)
+// {
+// const std::tr1::shared_ptr<const RequiredConfirmations> r(job.required_confirmations());
+// if (! r->empty())
+// cout << c::bold_red() << " Cannot proceed without: " << c::normal() <<
+// join(indirect_iterator(r->begin()), indirect_iterator(r->end()), ", ", stringify_confirmation) << endl;
+// }
void display_one_installish(
const std::tr1::shared_ptr<Environment> & env,
const DisplayResolutionCommandLine & cmdline,
const ChangesToMakeDecision & decision,
const std::tr1::shared_ptr<const Resolution> & resolution,
- const SimpleInstallJob & job,
const bool more_annotations,
- const bool confirmations,
const bool untaken,
ChoicesToExplain & choices_to_explain)
{
@@ -744,39 +742,26 @@ namespace
display_one_description(env, cmdline, decision.origin_id(), ! old_id);
display_choices(env, cmdline, decision.origin_id(), old_id, choices_to_explain);
display_reasons(resolution, more_annotations);
- if (confirmations)
- display_confirmations(job);
- }
-
- void display_one_install(
- const std::tr1::shared_ptr<Environment> & env,
- const DisplayResolutionCommandLine & cmdline,
- const SimpleInstallJob & job,
- const bool more_annotations,
- const bool confirmations,
- const bool untaken,
- ChoicesToExplain & choices_to_explain)
- {
- display_one_installish(env, cmdline, *job.changes_to_make_decision(), job.resolution(),
- job, more_annotations, confirmations, untaken, choices_to_explain);
+ // if (confirmations)
+ // display_confirmations(job);
}
void display_one_uninstall(
const std::tr1::shared_ptr<Environment> &,
const DisplayResolutionCommandLine &,
- const UninstallJob & job,
+ const std::tr1::shared_ptr<const Resolution> & resolution,
+ const RemoveDecision & decision,
const bool more_annotations,
- const bool confirmations,
const bool untaken)
{
if (untaken)
- cout << "(<) " << c::bold_green() << job.resolution()->resolvent().package() << c::normal() << " ";
+ cout << "(<) " << c::bold_green() << decision.resolvent().package() << c::normal() << " ";
else
- cout << "< " << c::bold_green() << job.resolution()->resolvent().package() << c::normal() << " ";
+ cout << "< " << c::bold_green() << decision.resolvent().package() << c::normal() << " ";
bool first(true);
- for (PackageIDSequence::ConstIterator i(job.remove_decision()->ids()->begin()),
- i_end(job.remove_decision()->ids()->end()) ;
+ for (PackageIDSequence::ConstIterator i(decision.ids()->begin()),
+ i_end(decision.ids()->end()) ;
i != i_end ; ++i)
{
if (! first)
@@ -787,18 +772,9 @@ namespace
}
cout << endl;
- display_reasons(job.resolution(), more_annotations);
- if (confirmations)
- display_confirmations(job);
- }
-
- void display_special_job_decision(
- const std::tr1::shared_ptr<Environment> &,
- const DisplayResolutionCommandLine &,
- const std::string & job_name,
- const std::tr1::shared_ptr<const PackageID> & id)
- {
- cout << "- " << job_name << " " << *id << endl;
+ display_reasons(resolution, more_annotations);
+// if (confirmations)
+// display_confirmations(job);
}
struct NotFixableMask
@@ -1067,151 +1043,130 @@ namespace
}
}
- struct ShowJobsDisplayer
- {
- const std::tr1::shared_ptr<Environment> env;
- const DisplayResolutionCommandLine & cmdline;
- const ResolverLists & lists;
- const bool all;
- const bool more_annotations;
- const bool confirmations;
- const bool untaken;
- ChoicesToExplain & choices_to_explain;
-
- ShowJobsDisplayer(
- const std::tr1::shared_ptr<Environment> & e,
- const DisplayResolutionCommandLine & c,
- const ResolverLists & l,
- const bool a,
- const bool n,
- const bool f,
- const bool u,
- ChoicesToExplain & x
- ) :
- env(e),
- cmdline(c),
- lists(l),
- all(a),
- more_annotations(n),
- confirmations(f),
- untaken(u),
- choices_to_explain(x)
- {
- }
-
- bool visit(const SimpleInstallJob & job)
- {
- display_one_install(env, cmdline, job, more_annotations, confirmations, untaken, choices_to_explain);
- return true;
- }
- bool visit(const UninstallJob & job)
- {
- display_one_uninstall(env, cmdline, job, more_annotations, confirmations, untaken);
- return true;
- }
-
- bool visit(const UsableJob & job, const bool indent = false)
- {
- if (! all)
- return false;
-
- if (indent)
- cout << " ";
- cout << "- " << c::bold_normal() << job.resolution()->resolvent() << c::normal() << " now usable" << endl;
- return true;
- }
-
- bool visit(const UsableGroupJob & job)
- {
- if (! all)
- return false;
-
- cout << "- " << c::bold_normal() << "group of jobs now usable:" << c::normal() << endl;
- for (JobIDSequence::ConstIterator i(job.job_ids()->begin()), i_end(job.job_ids()->end()) ;
- i != i_end ; ++i)
- visit(*lists.jobs()->fetch_as<UsableJob>(*i), true);
- return true;
- }
-
- bool visit(const FetchJob & job)
- {
- if (! all)
- return false;
-
- cout << "- " << c::bold_normal() << job.resolution()->resolvent() << c::normal() << " fetch" << endl;
- return true;
- }
+// void display_confirmation_jobs(
+// const std::tr1::shared_ptr<Environment> & env,
+// const ResolverLists & lists,
+// const DisplayResolutionCommandLine & cmdline)
+// {
+// Context context("When displaying jobs requiring confirmation:");
+//
+// if (lists.job_ids_needing_confirmation()->empty())
+// return;
+//
+// cout << "I cannot proceed without being permitted to do the following:" << endl << endl;
+//
+// for (JobIDSequence::ConstIterator i(lists.job_ids_needing_confirmation()->begin()),
+// i_end(lists.job_ids_needing_confirmation()->end()) ;
+// i != i_end ; ++i)
+// {
+// const std::tr1::shared_ptr<const Job> job(lists.jobs()->fetch(*i));
+// ChoicesToExplain ignore_choices_to_explain;
+// ShowJobsDisplayer d(env, cmdline, lists, cmdline.display_options.a_show_all_jobs.specified() ||
+// ! job->used_existing_packages_when_ordering()->empty(), true, true, false,
+// ignore_choices_to_explain);
+// if (! job->accept_returning<bool>(d))
+// throw InternalError(PALUDIS_HERE, "why didn't we get true?");
+// }
+//
+// cout << endl;
+// }
- bool visit(const ErrorJob &)
- {
- return false;
- }
- };
-
- struct JobNameVisitor
+ void display_choices_to_explain(
+ const std::tr1::shared_ptr<Environment> &,
+ const DisplayResolutionCommandLine &,
+ const ChoicesToExplain & choices_to_explain)
{
- const std::string visit(const SimpleInstallJob & j) const
- {
- return "install " + stringify(*j.changes_to_make_decision()->origin_id());
- }
-
- const std::string visit(const UninstallJob & j) const
- {
- return "uninstall " + stringify(j.resolution()->resolvent());
- }
-
- const std::string visit(const UsableJob & j) const
- {
- return "usable " + stringify(j.resolution()->resolvent());
- }
+ Context context("When displaying choices to explain:");
- const std::string visit(const ErrorJob &) const
+ for (ChoicesToExplain::const_iterator p(choices_to_explain.begin()), p_end(choices_to_explain.end()) ;
+ p != p_end ; ++p)
{
- return "error";
- }
+ cout << p->first << ":" << endl;
+ for (ChoiceValuesToExplain::const_iterator v(p->second.begin()), v_end(p->second.end()) ;
+ v != v_end ; ++v)
+ {
+ bool all_same(true);
+ const std::tr1::shared_ptr<const ChoiceValue> first_choice_value(
+ (*v->second->begin())->choices_key()->value()->find_by_name_with_prefix(v->first));
+ std::string description(first_choice_value->description());
+ for (PackageIDSequence::ConstIterator w(next(v->second->begin())), w_end(v->second->end()) ;
+ w != w_end ; ++w)
+ if ((*w)->choices_key()->value()->find_by_name_with_prefix(v->first)->description() != description)
+ {
+ all_same = false;
+ break;
+ }
- const std::string visit(const FetchJob & j) const
- {
- return "fetch " + stringify(*j.changes_to_make_decision()->origin_id());
- }
+ if (all_same)
+ cout << " " << std::left << std::setw(30) << (stringify(first_choice_value->unprefixed_name())
+ + ":") << " " << description << endl;
+ else
+ {
+ cout << " " << first_choice_value->unprefixed_name() << ":" << endl;
+ for (PackageIDSequence::ConstIterator w(v->second->begin()), w_end(v->second->end()) ;
+ w != w_end ; ++w)
+ {
+ const std::tr1::shared_ptr<const ChoiceValue> value(
+ (*w)->choices_key()->value()->find_by_name_with_prefix(v->first));
+ cout << " " << std::left << std::setw(30) <<
+ ((*w)->canonical_form(idcf_no_version) + ":") << " " << value->description() << endl;
+ }
+ }
+ }
- const std::string visit(const UsableGroupJob & j) const
- {
- return "usable (" + stringify(std::distance(j.job_ids()->begin(), j.job_ids()->end())) + ")";
+ cout << endl;
}
- };
+ }
- void display_jobs(
+ void display_a_changes_and_removes(
const std::tr1::shared_ptr<Environment> & env,
- const ResolverLists & lists,
+ const std::tr1::shared_ptr<const Resolved> & resolved,
+ const std::tr1::shared_ptr<const Decisions<ChangeOrRemoveDecision> > & decisions,
const DisplayResolutionCommandLine & cmdline,
- ChoicesToExplain & choices_to_explain)
+ ChoicesToExplain & choices_to_explain,
+ const bool more_annotations,
+ const bool untaken)
{
- Context context("When displaying jobs:");
+ Context context("When displaying changes and removes:");
- cout << "These are the actions I will take, in order:" << endl << endl;
+ if (untaken)
+ cout << "I did not take the following:" << endl << endl;
+ else
+ cout << "These are the actions I will take, in order:" << endl << endl;
bool any(false);
- for (JobIDSequence::ConstIterator i(lists.taken_job_ids()->begin()),
- i_end(lists.taken_job_ids()->end()) ;
+ for (Decisions<ChangeOrRemoveDecision>::ConstIterator i(decisions->begin()),
+ i_end(decisions->end()) ;
i != i_end ; ++i)
{
- const std::tr1::shared_ptr<const Job> job(lists.jobs()->fetch(*i));
- ShowJobsDisplayer d(env, cmdline, lists, cmdline.display_options.a_show_all_jobs.specified() ||
- ! job->used_existing_packages_when_ordering()->empty(), false, false, false, choices_to_explain);
- any |= job->accept_returning<bool>(d);
+ any = true;
- if (! job->used_existing_packages_when_ordering()->empty())
+ const ChangesToMakeDecision * const changes_to_make_decision(simple_visitor_cast<const ChangesToMakeDecision>(**i));
+ const RemoveDecision * const remove_decision(simple_visitor_cast<const RemoveDecision>(**i));
+ if (changes_to_make_decision)
{
- std::set<std::string> missing;
- for (JobIDSequence::ConstIterator j(job->used_existing_packages_when_ordering()->begin()),
- j_end(job->used_existing_packages_when_ordering()->end()) ;
- j != j_end ; ++j)
- missing.insert(lists.jobs()->fetch(*j)->accept_returning<std::string>(JobNameVisitor()));
- cout << " " << c::bold_normal() << "Couldn't do before: " << c::normal()
- << join(missing.begin(), missing.end(), ", ") << endl;
+ display_one_installish(
+ env,
+ cmdline,
+ *changes_to_make_decision,
+ *resolved->resolutions_by_resolvent()->find(changes_to_make_decision->resolvent()),
+ more_annotations,
+ untaken,
+ choices_to_explain);
}
+ else if (remove_decision)
+ {
+ display_one_uninstall(
+ env,
+ cmdline,
+ *resolved->resolutions_by_resolvent()->find(remove_decision->resolvent()),
+ *remove_decision,
+ more_annotations,
+ untaken);
+ }
+ else
+ throw InternalError(PALUDIS_HERE, "huh?");
}
if (! any)
@@ -1220,150 +1175,75 @@ namespace
cout << endl;
}
- void display_one_error(
+ void display_changes_and_removes(
const std::tr1::shared_ptr<Environment> & env,
- const DisplayResolutionCommandLine &,
- const std::tr1::shared_ptr<const Resolution> & resolution,
- const ErrorJob & j,
- const bool untaken)
+ const std::tr1::shared_ptr<const Resolved> & resolved,
+ const DisplayResolutionCommandLine & cmdline,
+ ChoicesToExplain & choices_to_explain)
{
- display_unable_to_make_decision(env, resolution, *j.unable_to_make_decision(), untaken);
+ display_a_changes_and_removes(env, resolved, resolved->display_change_or_remove_decisions(),
+ cmdline, choices_to_explain, false, false);
}
- void display_untaken(
+ void display_untaken_changes_and_removes(
const std::tr1::shared_ptr<Environment> & env,
- const ResolverLists & lists,
+ const std::tr1::shared_ptr<const Resolved> & resolved,
const DisplayResolutionCommandLine & cmdline,
ChoicesToExplain & choices_to_explain)
{
- Context context("When displaying untaken jobs:");
-
- if (lists.untaken_job_ids()->empty() && lists.untaken_error_job_ids()->empty())
- return;
-
- cout << "I did not take the following:" << endl << endl;
-
- for (JobIDSequence::ConstIterator i(lists.untaken_job_ids()->begin()),
- i_end(lists.untaken_job_ids()->end()) ;
- i != i_end ; ++i)
- {
- const std::tr1::shared_ptr<const Job> job(lists.jobs()->fetch(*i));
- ShowJobsDisplayer d(env, cmdline, lists, cmdline.display_options.a_show_all_jobs.specified() ||
- ! job->used_existing_packages_when_ordering()->empty(), true, false, true, choices_to_explain);
- if (! job->accept_returning<bool>(d))
- throw InternalError(PALUDIS_HERE, "why didn't we get true?");
- }
-
- for (JobIDSequence::ConstIterator i(lists.untaken_error_job_ids()->begin()),
- i_end(lists.untaken_error_job_ids()->end()) ;
- i != i_end ; ++i)
- {
- const std::tr1::shared_ptr<const ErrorJob> job(lists.jobs()->fetch_as<ErrorJob>(*i));
- display_one_error(env, cmdline, job->resolution(), *job, true);
- }
-
- cout << endl;
+ if (! resolved->untaken_change_or_remove_decisions()->empty())
+ display_a_changes_and_removes(env, resolved, resolved->untaken_change_or_remove_decisions(),
+ cmdline, choices_to_explain, true, true);
}
- void display_confirmation_jobs(
+ void display_an_errors(
const std::tr1::shared_ptr<Environment> & env,
- const ResolverLists & lists,
- const DisplayResolutionCommandLine & cmdline)
+ const std::tr1::shared_ptr<const Resolved> & resolved,
+ const std::tr1::shared_ptr<const Decisions<UnableToMakeDecision> > & decisions,
+ const DisplayResolutionCommandLine &,
+ const bool untaken)
{
- Context context("When displaying jobs requiring confirmation:");
-
- if (lists.job_ids_needing_confirmation()->empty())
- return;
+ Context context("When displaying errors:");
- cout << "I cannot proceed without being permitted to do the following:" << endl << endl;
+ if (untaken)
+ cout << "I encountered the following errors for untaken packages:" << endl << endl;
+ else
+ cout << "I encountered the following errors:" << endl << endl;
- for (JobIDSequence::ConstIterator i(lists.job_ids_needing_confirmation()->begin()),
- i_end(lists.job_ids_needing_confirmation()->end()) ;
+ bool any(false);
+ for (Decisions<UnableToMakeDecision>::ConstIterator i(decisions->begin()),
+ i_end(decisions->end()) ;
i != i_end ; ++i)
{
- const std::tr1::shared_ptr<const Job> job(lists.jobs()->fetch(*i));
- ChoicesToExplain ignore_choices_to_explain;
- ShowJobsDisplayer d(env, cmdline, lists, cmdline.display_options.a_show_all_jobs.specified() ||
- ! job->used_existing_packages_when_ordering()->empty(), true, true, false,
- ignore_choices_to_explain);
- if (! job->accept_returning<bool>(d))
- throw InternalError(PALUDIS_HERE, "why didn't we get true?");
+ any = true;
+
+ display_unable_to_make_decision(
+ env,
+ *resolved->resolutions_by_resolvent()->find((*i)->resolvent()),
+ **i,
+ untaken);
}
cout << endl;
}
- void display_errors(
+ void display_taken_errors(
const std::tr1::shared_ptr<Environment> & env,
- const ResolverLists & lists,
+ const std::tr1::shared_ptr<const Resolved> & resolved,
const DisplayResolutionCommandLine & cmdline)
{
- Context context("When displaying errors:");
-
- if (lists.taken_error_job_ids()->empty())
- return;
-
- cout << "I encountered the following errors:" << endl << endl;
-
- for (JobIDSequence::ConstIterator i(lists.taken_error_job_ids()->begin()),
- i_end(lists.taken_error_job_ids()->end()) ;
- i != i_end ; ++i)
- {
- const std::tr1::shared_ptr<const ErrorJob> job(lists.jobs()->fetch_as<ErrorJob>(*i));
- display_one_error(env, cmdline, job->resolution(), *job, false);
- }
-
- cout << endl;
+ if (! resolved->taken_unable_to_make_decisions()->empty())
+ display_an_errors(env, resolved, resolved->taken_unable_to_make_decisions(), cmdline, false);
}
- void display_choices_to_explain(
- const std::tr1::shared_ptr<Environment> &,
- const ResolverLists &,
- const DisplayResolutionCommandLine &,
- const ChoicesToExplain & choices_to_explain)
+ void display_untaken_errors(
+ const std::tr1::shared_ptr<Environment> & env,
+ const std::tr1::shared_ptr<const Resolved> & resolved,
+ const DisplayResolutionCommandLine & cmdline)
{
- Context context("When displaying choices to explain:");
-
- for (ChoicesToExplain::const_iterator p(choices_to_explain.begin()), p_end(choices_to_explain.end()) ;
- p != p_end ; ++p)
- {
- cout << p->first << ":" << endl;
- for (ChoiceValuesToExplain::const_iterator v(p->second.begin()), v_end(p->second.end()) ;
- v != v_end ; ++v)
- {
- bool all_same(true);
- const std::tr1::shared_ptr<const ChoiceValue> first_choice_value(
- (*v->second->begin())->choices_key()->value()->find_by_name_with_prefix(v->first));
- std::string description(first_choice_value->description());
- for (PackageIDSequence::ConstIterator w(next(v->second->begin())), w_end(v->second->end()) ;
- w != w_end ; ++w)
- if ((*w)->choices_key()->value()->find_by_name_with_prefix(v->first)->description() != description)
- {
- all_same = false;
- break;
- }
-
- if (all_same)
- cout << " " << std::left << std::setw(30) << (stringify(first_choice_value->unprefixed_name())
- + ":") << " " << description << endl;
- else
- {
- cout << " " << first_choice_value->unprefixed_name() << ":" << endl;
- for (PackageIDSequence::ConstIterator w(v->second->begin()), w_end(v->second->end()) ;
- w != w_end ; ++w)
- {
- const std::tr1::shared_ptr<const ChoiceValue> value(
- (*w)->choices_key()->value()->find_by_name_with_prefix(v->first));
- cout << " " << std::left << std::setw(30) <<
- ((*w)->canonical_form(idcf_no_version) + ":") << " " << value->description() << endl;
- }
- }
- }
-
- cout << endl;
- }
+ if (! resolved->untaken_unable_to_make_decisions()->empty())
+ display_an_errors(env, resolved, resolved->untaken_unable_to_make_decisions(), cmdline, true);
}
-
}
bool
@@ -1376,7 +1256,7 @@ int
DisplayResolutionCommand::run(
const std::tr1::shared_ptr<Environment> & env,
const std::tr1::shared_ptr<const Sequence<std::string > > & args,
- const std::tr1::shared_ptr<const ResolverLists> & maybe_lists
+ const std::tr1::shared_ptr<const Resolved> & maybe_resolved
)
{
DisplayResolutionCommandLine cmdline;
@@ -1390,8 +1270,8 @@ DisplayResolutionCommand::run(
cmdline.import_options.apply(env);
- std::tr1::shared_ptr<const ResolverLists> lists(maybe_lists);
- if (! lists)
+ std::tr1::shared_ptr<const Resolved> resolved(maybe_resolved);
+ if (! resolved)
{
if (getenv_with_default("PALUDIS_SERIALISED_RESOLUTION_FD", "").empty())
throw args::DoHelp("PALUDIS_SERIALISED_RESOLUTION_FD must be provided");
@@ -1399,18 +1279,18 @@ DisplayResolutionCommand::run(
int fd(destringify<int>(getenv_with_default("PALUDIS_SERIALISED_RESOLUTION_FD", "")));
SafeIFStream deser_stream(fd);
Deserialiser deserialiser(env.get(), deser_stream);
- Deserialisation deserialisation("ResolverLists", deserialiser);
- lists = make_shared_copy(ResolverLists::deserialise(deserialisation));
+ Deserialisation deserialisation("Resolved", deserialiser);
+ resolved = make_shared_copy(Resolved::deserialise(deserialisation));
close(fd);
}
ChoicesToExplain choices_to_explain;
- display_jobs(env, *lists, cmdline, choices_to_explain);
- display_untaken(env, *lists, cmdline, choices_to_explain);
- display_choices_to_explain(env, *lists, cmdline, choices_to_explain);
- display_confirmation_jobs(env, *lists, cmdline);
- display_errors(env, *lists, cmdline);
- display_explanations(env, *lists, cmdline);
+ display_changes_and_removes(env, resolved, cmdline, choices_to_explain);
+ display_untaken_changes_and_removes(env, resolved, cmdline, choices_to_explain);
+ display_choices_to_explain(env, cmdline, choices_to_explain);
+ display_taken_errors(env, resolved, cmdline);
+ display_untaken_errors(env, resolved, cmdline);
+ display_explanations(env, resolved, cmdline);
return 0;
}
diff --git a/src/clients/cave/cmd_display_resolution.hh b/src/clients/cave/cmd_display_resolution.hh
index 6f01f7f..aa23e8a 100644
--- a/src/clients/cave/cmd_display_resolution.hh
+++ b/src/clients/cave/cmd_display_resolution.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_SRC_CLIENTS_CAVE_CMD_DISPLAY_RESOLUTION_HH 1
#include "command.hh"
-#include <paludis/resolver/resolver_lists-fwd.hh>
+#include <paludis/resolver/resolved-fwd.hh>
namespace paludis
{
@@ -41,7 +41,7 @@ namespace paludis
int run(
const std::tr1::shared_ptr<Environment> &,
const std::tr1::shared_ptr<const Sequence<std::string > > & args,
- const std::tr1::shared_ptr<const resolver::ResolverLists> & maybe_lists
+ const std::tr1::shared_ptr<const resolver::Resolved> & maybe_resolved
);
std::tr1::shared_ptr<args::ArgsHandler> make_doc_cmdline();
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index e528aed..ffdf1d6 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -1188,9 +1188,16 @@ namespace
ser_stream.nothing_more_to_write();
}
+ void serialise_resolved(StringListStream & ser_stream, const Resolved & resolved)
+ {
+ Serialiser ser(ser_stream);
+ resolved.serialise(ser);
+ ser_stream.nothing_more_to_write();
+ }
+
int display_resolution(
const std::tr1::shared_ptr<Environment> & env,
- const std::tr1::shared_ptr<const ResolverLists> & resolution_lists,
+ const std::tr1::shared_ptr<const Resolved> & resolved,
const ResolveCommandLineResolutionOptions &,
const ResolveCommandLineDisplayOptions & display_options,
const ResolveCommandLineProgramOptions & program_options,
@@ -1200,9 +1207,9 @@ namespace
Context context("When displaying chosen resolution:");
StringListStream ser_stream;
- Thread ser_thread(std::tr1::bind(&ser_thread_func,
+ Thread ser_thread(std::tr1::bind(&serialise_resolved,
std::tr1::ref(ser_stream),
- std::tr1::cref(*resolution_lists)));
+ std::tr1::cref(*resolved)));
std::tr1::shared_ptr<Sequence<std::string> > args(new Sequence<std::string>);
@@ -1246,7 +1253,7 @@ namespace
return run_command(cmd);
}
else
- return DisplayResolutionCommand().run(env, args, resolution_lists);
+ return DisplayResolutionCommand().run(env, args, resolved);
}
int perform_resolution(
@@ -1670,7 +1677,7 @@ paludis::cave::resolve_common(
dump_if_requested(env, resolver, resolution_options);
- retcode |= display_resolution(env, resolver->lists(), resolution_options,
+ retcode |= display_resolution(env, resolver->resolved(), resolution_options,
display_options, program_options, keys_if_import, targets);
if (! resolver->lists()->taken_error_job_ids()->empty())