aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-14 16:59:26 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-14 16:59:26 +0100
commitc62763e2ec713c778e4674cdeae2b46a4f702ead (patch)
tree9fa24e4133b9fa4db7a9d794d0924e009fe03797
parent60524d3a9ae514b518142e81080cb0d867fb8b0b (diff)
downloadpaludis-c62763e2ec713c778e4674cdeae2b46a4f702ead.tar.gz
paludis-c62763e2ec713c778e4674cdeae2b46a4f702ead.tar.xz
Don't pass a Resolvent and a Resolution to Fns either
-rw-r--r--paludis/resolver/decider.cc6
-rw-r--r--paludis/resolver/orderer.cc4
-rw-r--r--paludis/resolver/resolver_functions.hh4
-rw-r--r--paludis/resolver/resolver_test.cc8
-rw-r--r--paludis/resolver/resolver_test.hh4
-rw-r--r--src/clients/cave/resolve_common.cc24
6 files changed, 17 insertions, 33 deletions
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index ee4620a..b5c6350 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -194,7 +194,7 @@ Decider::_make_constraints_for_dependent(
const std::tr1::shared_ptr<const PackageID> & id,
const std::tr1::shared_ptr<const PackageIDSequence> & r) const
{
- return _imp->fns.get_constraints_for_dependent_fn()(resolution->resolvent(), resolution, id, r);
+ return _imp->fns.get_constraints_for_dependent_fn()(resolution, id, r);
}
namespace
@@ -487,7 +487,7 @@ Decider::_find_repository_for(
const std::tr1::shared_ptr<const Resolution> & resolution,
const ChangesToMakeDecision & decision) const
{
- return _imp->fns.find_repository_for_fn()(resolution->resolvent(), resolution, decision);
+ return _imp->fns.find_repository_for_fn()(resolution, decision);
}
FilteredGenerator
@@ -1043,7 +1043,7 @@ Decider::_add_dependencies_if_necessary(
SpecInterest
Decider::_interest_in_spec(const std::tr1::shared_ptr<const Resolution> & resolution, const SanitisedDependency & dep) const
{
- return _imp->fns.interest_in_spec_fn()(resolution->resolvent(), resolution, dep);
+ return _imp->fns.interest_in_spec_fn()(resolution, dep);
}
const std::tr1::shared_ptr<Constraints>
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index 29b5c78..f79f7f6 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -296,14 +296,14 @@ Orderer::_confirm(
if (! decision.best())
{
const std::tr1::shared_ptr<RequiredConfirmation> c(new NotBestConfirmation);
- if (! _imp->fns.confirm_fn()(resolution->resolvent(), resolution, c))
+ if (! _imp->fns.confirm_fn()(resolution, c))
job->required_confirmations()->push_back(c);
}
if (ct_downgrade == decision.change_type())
{
const std::tr1::shared_ptr<DowngradeConfirmation> c(new DowngradeConfirmation);
- if (! _imp->fns.confirm_fn()(resolution->resolvent(), resolution, c))
+ if (! _imp->fns.confirm_fn()(resolution, c))
job->required_confirmations()->push_back(c);
}
diff --git a/paludis/resolver/resolver_functions.hh b/paludis/resolver/resolver_functions.hh
index 08c8661..b435ece 100644
--- a/paludis/resolver/resolver_functions.hh
+++ b/paludis/resolver/resolver_functions.hh
@@ -71,19 +71,16 @@ namespace paludis
)> AllowedToRemoveFunction;
typedef std::tr1::function<bool (
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const std::tr1::shared_ptr<const RequiredConfirmation> &
)> ConfirmFunction;
typedef std::tr1::function<const std::tr1::shared_ptr<const Repository> (
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const ChangesToMakeDecision &
)> FindRepositoryForFunction;
typedef std::tr1::function<std::tr1::shared_ptr<ConstraintSequence> (
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const std::tr1::shared_ptr<const PackageID> &,
const std::tr1::shared_ptr<const PackageIDSequence> &
@@ -112,7 +109,6 @@ namespace paludis
)> GetUseExistingFunction;
typedef std::tr1::function<SpecInterest (
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const SanitisedDependency &
)> InterestInSpecFunction;
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index c7c0fa4..0ad7543 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -217,7 +217,7 @@ paludis::resolver::resolver_test::is_just_suggestion(const SanitisedDependency &
SpecInterest
paludis::resolver::resolver_test::interest_in_spec_fn(
- const Resolvent &, const std::tr1::shared_ptr<const Resolution> &, const SanitisedDependency & dep)
+ const std::tr1::shared_ptr<const Resolution> &, const SanitisedDependency & dep)
{
if (is_just_suggestion(dep))
return si_untaken;
@@ -237,7 +237,6 @@ paludis::resolver::resolver_test::get_use_existing_fn(
const std::tr1::shared_ptr<const Repository>
paludis::resolver::resolver_test::find_repository_for_fn(
const Environment * const env,
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const ChangesToMakeDecision &)
{
@@ -282,7 +281,6 @@ paludis::resolver::resolver_test::prefer_or_avoid_fn(
bool
paludis::resolver::resolver_test::confirm_fn(
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const std::tr1::shared_ptr<const RequiredConfirmation> &)
{
@@ -291,7 +289,6 @@ paludis::resolver::resolver_test::confirm_fn(
const std::tr1::shared_ptr<ConstraintSequence>
paludis::resolver::resolver_test::get_constraints_for_dependent_fn(
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const std::tr1::shared_ptr<const PackageID> & id,
const std::tr1::shared_ptr<const PackageIDSequence> & ids)
@@ -381,8 +378,7 @@ ResolverTestCase::get_resolver_functions(InitialConstraints & initial_constraint
allowed_to_remove_names, std::tr1::placeholders::_1),
n::confirm_fn() = &confirm_fn,
n::find_repository_for_fn() = std::tr1::bind(&find_repository_for_fn,
- &env, std::tr1::placeholders::_1, std::tr1::placeholders::_2,
- std::tr1::placeholders::_3),
+ &env, std::tr1::placeholders::_1, std::tr1::placeholders::_2),
n::get_constraints_for_dependent_fn() = &get_constraints_for_dependent_fn,
n::get_destination_types_for_fn() = &get_destination_types_for_fn,
n::get_initial_constraints_for_fn() =
diff --git a/paludis/resolver/resolver_test.hh b/paludis/resolver/resolver_test.hh
index b4b5b4a..ee12d61 100644
--- a/paludis/resolver/resolver_test.hh
+++ b/paludis/resolver/resolver_test.hh
@@ -59,7 +59,6 @@ namespace paludis
typedef std::map<Resolvent, std::tr1::shared_ptr<Constraints> > InitialConstraints;
SpecInterest interest_in_spec_fn(
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const SanitisedDependency &);
@@ -69,7 +68,6 @@ namespace paludis
const std::tr1::shared_ptr<ConstraintSequence>
get_constraints_for_dependent_fn(
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const std::tr1::shared_ptr<const PackageID> & id,
const std::tr1::shared_ptr<const PackageIDSequence> & ids);
@@ -87,7 +85,6 @@ namespace paludis
const std::tr1::shared_ptr<const Repository> find_repository_for_fn(
const Environment * const,
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const ChangesToMakeDecision &);
@@ -114,7 +111,6 @@ namespace paludis
const QualifiedPackageName &);
bool confirm_fn(
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const std::tr1::shared_ptr<const RequiredConfirmation> &);
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 38df796..794c103 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -839,7 +839,6 @@ namespace
const PackageDepSpecList & ignore_from,
const PackageDepSpecList & no_blockers_from,
const PackageDepSpecList & no_dependencies_from,
- const Resolvent & resolvent,
const std::tr1::shared_ptr<const Resolution> & resolution,
const SanitisedDependency & dep)
{
@@ -862,7 +861,7 @@ namespace
for (PackageDepSpecList::const_iterator l(take_from.begin()), l_end(take_from.end()) ;
l != l_end ; ++l)
{
- if (match_qpns(*env, *l, resolvent.package()))
+ if (match_qpns(*env, *l, resolution->resolvent().package()))
return si_take;
}
@@ -877,7 +876,7 @@ namespace
for (PackageDepSpecList::const_iterator l(ignore_from.begin()), l_end(ignore_from.end()) ;
l != l_end ; ++l)
{
- if (match_qpns(*env, *l, resolvent.package()))
+ if (match_qpns(*env, *l, resolution->resolvent().package()))
return si_ignore;
}
@@ -917,8 +916,7 @@ namespace
const std::tr1::shared_ptr<const Repository>
find_repository_for_fn(const Environment * const env,
const ResolveCommandLineResolutionOptions &,
- const Resolvent & resolvent,
- const std::tr1::shared_ptr<const Resolution> &,
+ const std::tr1::shared_ptr<const Resolution> & resolution,
const ChangesToMakeDecision & decision)
{
std::tr1::shared_ptr<const Repository> result;
@@ -926,7 +924,7 @@ namespace
r_end(env->package_database()->end_repositories()) ;
r != r_end ; ++r)
{
- switch (resolvent.destination_type())
+ switch (resolution->resolvent().destination_type())
{
case dt_install_to_slash:
if ((! (*r)->installed_root_key()) || ((*r)->installed_root_key()->value() != FSEntry("/")))
@@ -947,7 +945,7 @@ namespace
{
if (result)
throw ConfigurationError("For '" + stringify(*decision.origin_id())
- + "' with destination type " + stringify(resolvent.destination_type())
+ + "' with destination type " + stringify(resolution->resolvent().destination_type())
+ ", don't know whether to install to ::" + stringify(result->name())
+ " or ::" + stringify((*r)->name()));
else
@@ -957,7 +955,7 @@ namespace
if (! result)
throw ConfigurationError("No repository suitable for '" + stringify(*decision.origin_id())
- + "' with destination type " + stringify(resolvent.destination_type()) + " has been configured");
+ + "' with destination type " + stringify(resolution->resolvent().destination_type()) + " has been configured");
return result;
}
@@ -1135,7 +1133,6 @@ namespace
const ResolveCommandLineResolutionOptions & resolution_options,
const PackageDepSpecList & permit_downgrade,
const PackageDepSpecList & permit_old_version,
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> & r,
const std::tr1::shared_ptr<const RequiredConfirmation> & c)
{
@@ -1147,7 +1144,6 @@ namespace
const std::tr1::shared_ptr<ConstraintSequence> get_constraints_for_dependent_fn(
const Environment * const env,
const PackageDepSpecList & list,
- const Resolvent &,
const std::tr1::shared_ptr<const Resolution> &,
const std::tr1::shared_ptr<const PackageID> & id,
const std::tr1::shared_ptr<const PackageIDSequence> & ids)
@@ -1605,11 +1601,11 @@ paludis::cave::resolve_common(
env.get(), std::tr1::cref(allowed_to_remove_specs), _1),
n::confirm_fn() = std::tr1::bind(&confirm_fn,
env.get(), std::tr1::cref(resolution_options), std::tr1::cref(permit_downgrade),
- std::tr1::cref(permit_old_version), _1, _2, _3),
+ std::tr1::cref(permit_old_version), _1, _2),
n::find_repository_for_fn() = std::tr1::bind(&find_repository_for_fn,
- env.get(), std::tr1::cref(resolution_options), _1, _2, _3),
+ env.get(), std::tr1::cref(resolution_options), _1, _2),
n::get_constraints_for_dependent_fn() = std::tr1::bind(&get_constraints_for_dependent_fn,
- env.get(), std::tr1::cref(less_restrictive_remove_blockers_specs), _1, _2, _3, _4),
+ env.get(), std::tr1::cref(less_restrictive_remove_blockers_specs), _1, _2, _3),
n::get_destination_types_for_fn() = std::tr1::bind(&get_destination_types_for_fn,
env.get(), std::tr1::cref(resolution_options), _1, _2, _3),
n::get_initial_constraints_for_fn() = std::tr1::bind(&initial_constraints_for_fn,
@@ -1622,7 +1618,7 @@ paludis::cave::resolve_common(
n::interest_in_spec_fn() = std::tr1::bind(&interest_in_spec_fn,
env.get(), std::tr1::cref(resolution_options), std::tr1::cref(take), std::tr1::cref(take_from),
std::tr1::cref(ignore), std::tr1::cref(ignore_from), std::tr1::cref(no_blockers_from),
- std::tr1::cref(no_dependencies_from), _1, _2, _3),
+ std::tr1::cref(no_dependencies_from), _1, _2),
n::make_destination_filtered_generator_fn() = std::tr1::bind(&make_destination_filtered_generator,
env.get(), std::tr1::cref(resolution_options), all_binary_repos_generator, _1, _2),
n::prefer_or_avoid_fn() = std::tr1::bind(&prefer_or_avoid_fn,