aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-16 23:11:49 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-16 23:19:51 +0000
commit48b71ce3fdfa8ecfe304c942f690ca2036720028 (patch)
tree2ccecc67325964d2f9d355c793e52eb529c3868a
parentb716a9fddb8e8af4e089b14143e9bd8d1ab28718 (diff)
downloadpaludis-48b71ce3fdfa8ecfe304c942f690ca2036720028.tar.gz
paludis-48b71ce3fdfa8ecfe304c942f690ca2036720028.tar.xz
take from, ignore from can have full IDs
-rw-r--r--paludis/resolver/decider.cc9
-rw-r--r--paludis/resolver/decider.hh1
-rw-r--r--paludis/resolver/interest_in_spec_helper.cc26
-rw-r--r--paludis/resolver/interest_in_spec_helper.hh1
-rw-r--r--paludis/resolver/resolver_functions.hh1
5 files changed, 23 insertions, 15 deletions
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index e937a2d..15e4bb9 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1163,7 +1163,7 @@ Decider::_add_dependencies_if_necessary(
{
Context context_2("When handling dependency '" + stringify(s->spec()) + "':");
- SpecInterest interest(_interest_in_spec(our_resolution, *s));
+ SpecInterest interest(_interest_in_spec(our_resolution, package_id, *s));
switch (interest)
{
@@ -1206,9 +1206,12 @@ Decider::_add_dependencies_if_necessary(
}
SpecInterest
-Decider::_interest_in_spec(const std::shared_ptr<const Resolution> & resolution, const SanitisedDependency & dep) const
+Decider::_interest_in_spec(
+ const std::shared_ptr<const Resolution> & resolution,
+ const std::shared_ptr<const PackageID> & id,
+ const SanitisedDependency & dep) const
{
- return _imp->fns.interest_in_spec_fn()(resolution, dep);
+ return _imp->fns.interest_in_spec_fn()(resolution, id, dep);
}
const std::shared_ptr<Constraints>
diff --git a/paludis/resolver/decider.hh b/paludis/resolver/decider.hh
index 1398653..c3f1d9c 100644
--- a/paludis/resolver/decider.hh
+++ b/paludis/resolver/decider.hh
@@ -208,6 +208,7 @@ namespace paludis
SpecInterest _interest_in_spec(
const std::shared_ptr<const Resolution> &,
+ const std::shared_ptr<const PackageID> &,
const SanitisedDependency &) const;
const std::shared_ptr<Constraints> _initial_constraints_for(const Resolvent &) const;
diff --git a/paludis/resolver/interest_in_spec_helper.cc b/paludis/resolver/interest_in_spec_helper.cc
index 76d7192..9781720 100644
--- a/paludis/resolver/interest_in_spec_helper.cc
+++ b/paludis/resolver/interest_in_spec_helper.cc
@@ -36,6 +36,7 @@
#include <paludis/environment.hh>
#include <paludis/package_dep_spec_collection.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/match_package.hh>
#include <list>
using namespace paludis;
@@ -230,6 +231,7 @@ namespace
SpecInterest
InterestInSpecHelper::operator() (
const std::shared_ptr<const Resolution> & resolution,
+ const std::shared_ptr<const PackageID> & id,
const SanitisedDependency & dep) const
{
CareAboutDepFnVisitor v{_imp->env, _imp->no_blockers_from_specs, _imp->no_dependencies_from_specs,
@@ -242,33 +244,33 @@ InterestInSpecHelper::operator() (
if (! (suggestion || recommendation))
return si_take;
- for (auto l(_imp->take_specs.begin()), l_end(_imp->take_specs.end()) ;
- l != l_end ; ++l)
+ if (dep.spec().if_package())
{
- PackageDepSpec spec(*dep.spec().if_package());
- if (match_qpns(*_imp->env, *l, *spec.package_ptr()))
- return si_take;
+ for (auto l(_imp->take_specs.begin()), l_end(_imp->take_specs.end()) ;
+ l != l_end ; ++l)
+ if (match_qpns(*_imp->env, *l, *dep.spec().if_package()->package_ptr()))
+ return si_take;
}
for (auto l(_imp->take_from_specs.begin()), l_end(_imp->take_from_specs.end()) ;
l != l_end ; ++l)
{
- if (match_qpns(*_imp->env, *l, resolution->resolvent().package()))
+ if (match_package(*_imp->env, *l, *id, { }))
return si_take;
}
- for (auto l(_imp->ignore_specs.begin()), l_end(_imp->ignore_specs.end()) ;
- l != l_end ; ++l)
+ if (dep.spec().if_package())
{
- PackageDepSpec spec(*dep.spec().if_package());
- if (match_qpns(*_imp->env, *l, *spec.package_ptr()))
- return si_ignore;
+ for (auto l(_imp->ignore_specs.begin()), l_end(_imp->ignore_specs.end()) ;
+ l != l_end ; ++l)
+ if (match_qpns(*_imp->env, *l, *dep.spec().if_package()->package_ptr()))
+ return si_ignore;
}
for (auto l(_imp->ignore_from_specs.begin()), l_end(_imp->ignore_from_specs.end()) ;
l != l_end ; ++l)
{
- if (match_qpns(*_imp->env, *l, resolution->resolvent().package()))
+ if (match_package(*_imp->env, *l, *id, { }))
return si_ignore;
}
diff --git a/paludis/resolver/interest_in_spec_helper.hh b/paludis/resolver/interest_in_spec_helper.hh
index 636d21f..34cccaa 100644
--- a/paludis/resolver/interest_in_spec_helper.hh
+++ b/paludis/resolver/interest_in_spec_helper.hh
@@ -58,6 +58,7 @@ namespace paludis
SpecInterest operator() (
const std::shared_ptr<const Resolution> &,
+ const std::shared_ptr<const PackageID> &,
const SanitisedDependency &) const;
};
}
diff --git a/paludis/resolver/resolver_functions.hh b/paludis/resolver/resolver_functions.hh
index ae65454..d05280e 100644
--- a/paludis/resolver/resolver_functions.hh
+++ b/paludis/resolver/resolver_functions.hh
@@ -149,6 +149,7 @@ namespace paludis
typedef std::function<SpecInterest (
const std::shared_ptr<const Resolution> &,
+ const std::shared_ptr<const PackageID> &,
const SanitisedDependency &
)> InterestInSpecFunction;