aboutsummaryrefslogtreecommitdiff
path: root/paludis/legacy
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/legacy')
-rw-r--r--paludis/legacy/dep_list-fwd.hh7
-rw-r--r--paludis/legacy/dep_list.cc22
-rw-r--r--paludis/legacy/install_task.cc10
-rw-r--r--paludis/legacy/query_visitor.cc4
-rw-r--r--paludis/legacy/range_rewriter.cc5
-rw-r--r--paludis/legacy/show_suggest_visitor.cc2
-rw-r--r--paludis/legacy/uninstall_list.cc4
-rw-r--r--paludis/legacy/uninstall_task.cc2
8 files changed, 28 insertions, 28 deletions
diff --git a/paludis/legacy/dep_list-fwd.hh b/paludis/legacy/dep_list-fwd.hh
index 4ed074643..727a0e68c 100644
--- a/paludis/legacy/dep_list-fwd.hh
+++ b/paludis/legacy/dep_list-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -43,7 +43,10 @@ namespace paludis
*
* \ingroup g_dep_list
*/
- bool is_viable_any_child(const DependencySpecTree::BasicNode & i);
+ bool is_viable_any_child(
+ const Environment * const,
+ const std::shared_ptr<const PackageID> &,
+ const DependencySpecTree::BasicNode & i);
}
#endif
diff --git a/paludis/legacy/dep_list.cc b/paludis/legacy/dep_list.cc
index b7c58c196..d7cc9f741 100644
--- a/paludis/legacy/dep_list.cc
+++ b/paludis/legacy/dep_list.cc
@@ -725,13 +725,13 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<ConditionalDepSpec
d->_imp->labels.push_front(*d->_imp->labels.begin());
RunOnDestruction restore_labels(std::bind(std::mem_fn(&LabelsStack::pop_front), &d->_imp->labels));
- if (node.spec()->condition_met())
+ if (node.spec()->condition_met(d->_imp->env, d->_imp->current_package_id()))
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()),
accept_visitor(*this));
}
else
{
- if (node.spec()->condition_meetable())
+ if (node.spec()->condition_meetable(d->_imp->env, d->_imp->current_package_id()))
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()),
accept_visitor(*this));
}
@@ -746,7 +746,8 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<AnyDepSpec>::Type
RunOnDestruction restore_labels(std::bind(std::mem_fn(&LabelsStack::pop_front), &d->_imp->labels));
/* annoying requirement: || ( foo? ( ... ) ) resolves to empty if !foo. */
- if (indirect_iterator(node.end()) == std::find_if(indirect_iterator(node.begin()), indirect_iterator(node.end()), &is_viable_any_child))
+ if (indirect_iterator(node.end()) == std::find_if(indirect_iterator(node.begin()), indirect_iterator(node.end()),
+ std::bind(&is_viable_any_child, d->_imp->env, d->_imp->current_package_id(), std::placeholders::_1)))
return;
{
@@ -766,7 +767,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<AnyDepSpec>::Type
for (DependencySpecTree::NodeType<AnyDepSpec>::Type::ConstIterator c(node.begin()), c_end(node.end()) ;
c != c_end ; ++c)
{
- if (! is_viable_any_child(**c))
+ if (! is_viable_any_child(d->_imp->env, d->_imp->current_package_id(), **c))
continue;
if (d->already_installed(**c, destinations))
@@ -788,7 +789,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<AnyDepSpec>::Type
for (DependencySpecTree::NodeType<AnyDepSpec>::Type::ConstIterator c(node.begin()), c_end(node.end()) ;
c != c_end ; ++c)
{
- if (! is_viable_any_child(**c))
+ if (! is_viable_any_child(d->_imp->env, d->_imp->current_package_id(), **c))
continue;
if (! is_interesting_any_child(*d->_imp->env, **c))
continue;
@@ -813,7 +814,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<AnyDepSpec>::Type
for (DependencySpecTree::NodeType<AnyDepSpec>::Type::ConstIterator c(node.begin()), c_end(node.end()) ;
c != c_end ; ++c)
{
- if (! is_viable_any_child(**c))
+ if (! is_viable_any_child(d->_imp->env, d->_imp->current_package_id(), **c))
continue;
try
@@ -839,7 +840,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<AnyDepSpec>::Type
for (DependencySpecTree::NodeType<AnyDepSpec>::Type::ConstIterator c(node.begin()), c_end(node.end()) ;
c != c_end ; ++c)
{
- if (! is_viable_any_child(**c))
+ if (! is_viable_any_child(d->_imp->env, d->_imp->current_package_id(), **c))
continue;
d->add_not_top_level(only_if_not_suggested_label, **c, destinations);
@@ -1170,7 +1171,7 @@ DepList::add_package(const std::shared_ptr<const PackageID> & p, const std::shar
/* add provides */
if (p->provide_key())
{
- DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(_imp->env);
+ DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(_imp->env, _imp->current_package_id());
p->provide_key()->value()->top()->accept(f);
if (f.begin() != f.end() && ! (*DistributionData::get_instance()->distribution_from_string(
@@ -1740,12 +1741,13 @@ DepList::push_back(const DepListEntry & e)
}
bool
-paludis::is_viable_any_child(const DependencySpecTree::BasicNode & i)
+paludis::is_viable_any_child(const Environment * const env,
+ const std::shared_ptr<const PackageID> & id, const DependencySpecTree::BasicNode & i)
{
const DependencySpecTree::NodeType<ConditionalDepSpec>::Type * const u(simple_visitor_cast<
const DependencySpecTree::NodeType<ConditionalDepSpec>::Type>(i));
if (0 != u)
- return u->spec()->condition_met();
+ return u->spec()->condition_met(env, id);
else
return true;
}
diff --git a/paludis/legacy/install_task.cc b/paludis/legacy/install_task.cc
index 2b3b2f5c3..9476bc366 100644
--- a/paludis/legacy/install_task.cc
+++ b/paludis/legacy/install_task.cc
@@ -1510,12 +1510,12 @@ namespace
struct CheckSatisfiedVisitor
{
const Environment * const env;
- const PackageID & id;
+ const std::shared_ptr<const PackageID> & id;
std::shared_ptr<const PackageDepSpec> failure;
std::set<SetName> recursing_sets;
CheckSatisfiedVisitor(const Environment * const e,
- const PackageID & i) :
+ const std::shared_ptr<const PackageID> & i) :
env(e),
id(i)
{
@@ -1545,7 +1545,7 @@ namespace
void visit(const DependencySpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
- if (node.spec()->condition_met())
+ if (node.spec()->condition_met(env, id))
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()),
accept_visitor(*this));
}
@@ -1596,7 +1596,7 @@ InstallTask::_unsatisfied(const DepListEntry & e) const
{
Context context("When checking whether dependencies for '" + stringify(*e.package_id()) + "' are satisfied:");
- CheckSatisfiedVisitor v(environment(), *e.package_id());
+ CheckSatisfiedVisitor v(environment(), e.package_id());
if (dl_deps_pre == _imp->dep_list.options()->uninstalled_deps_pre() ||
dl_deps_pre_or_post == _imp->dep_list.options()->uninstalled_deps_pre())
@@ -1786,7 +1786,7 @@ namespace
void visit(const DependencySpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
- if (node.spec()->condition_met())
+ if (node.spec()->condition_met(env, id))
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()),
accept_visitor(*this));
}
diff --git a/paludis/legacy/query_visitor.cc b/paludis/legacy/query_visitor.cc
index 655a86c43..0ddec62a6 100644
--- a/paludis/legacy/query_visitor.cc
+++ b/paludis/legacy/query_visitor.cc
@@ -140,7 +140,7 @@ QueryVisitor::visit(const DependencySpecTree::NodeType<ConditionalDepSpec>::Type
{
/* for use? ( ) dep specs, return true if we're not enabled, so that
* weird || ( ) cases work. */
- if (node.spec()->condition_met())
+ if (node.spec()->condition_met(_imp->environment, _imp->id))
{
_imp->result = true;
for (DependencySpecTree::NodeType<AnyDepSpec>::Type::ConstIterator c(node.begin()), c_end(node.end()) ;
@@ -174,7 +174,7 @@ QueryVisitor::visit(const DependencySpecTree::NodeType<AnyDepSpec>::Type & node)
for (DependencySpecTree::NodeType<AnyDepSpec>::Type::ConstIterator c(node.begin()), c_end(node.end()) ;
c != c_end ; ++c)
{
- if (! is_viable_any_child(**c))
+ if (! is_viable_any_child(_imp->environment, _imp->id, **c))
continue;
(*c)->accept(*this);
diff --git a/paludis/legacy/range_rewriter.cc b/paludis/legacy/range_rewriter.cc
index 65b69d958..311917bff 100644
--- a/paludis/legacy/range_rewriter.cc
+++ b/paludis/legacy/range_rewriter.cc
@@ -128,11 +128,6 @@ namespace
return std::shared_ptr<const SlotRequirement>();
}
- virtual std::shared_ptr<const MetadataSectionKey> annotations_key() const
- {
- return std::shared_ptr<const MetadataSectionKey>();
- }
-
virtual std::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements_ptr() const
{
return std::shared_ptr<const AdditionalPackageDepSpecRequirements>();
diff --git a/paludis/legacy/show_suggest_visitor.cc b/paludis/legacy/show_suggest_visitor.cc
index 14ad0423f..fa53eccb1 100644
--- a/paludis/legacy/show_suggest_visitor.cc
+++ b/paludis/legacy/show_suggest_visitor.cc
@@ -85,7 +85,7 @@ ShowSuggestVisitor::~ShowSuggestVisitor()
void
ShowSuggestVisitor::visit(const DependencySpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
- if (node.spec()->condition_met())
+ if (node.spec()->condition_met(_imp->environment, _imp->id))
{
_imp->labels.push_front(*_imp->labels.begin());
RunOnDestruction restore_labels(std::bind(std::mem_fn(&LabelsStack::pop_front), &_imp->labels));
diff --git a/paludis/legacy/uninstall_list.cc b/paludis/legacy/uninstall_list.cc
index 58989dfea..4ec04cff9 100644
--- a/paludis/legacy/uninstall_list.cc
+++ b/paludis/legacy/uninstall_list.cc
@@ -177,7 +177,7 @@ UninstallList::add_errors_for_system()
if ((! needed) && l->package_id()->provide_key())
{
- DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(_imp->env);
+ DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(_imp->env, l->package_id());
l->package_id()->provide_key()->value()->top()->accept(f);
for (DepSpecFlattener<ProvideSpecTree, PackageDepSpec>::ConstIterator v(f.begin()), v_end(f.end()) ;
v != v_end && ! needed ; ++v)
@@ -348,7 +348,7 @@ namespace
void visit(const DependencySpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
- if (node.spec()->condition_met())
+ if (node.spec()->condition_met(env, pkg))
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()),
accept_visitor(*this));
}
diff --git a/paludis/legacy/uninstall_task.cc b/paludis/legacy/uninstall_task.cc
index e02f4b889..98bf9efcf 100644
--- a/paludis/legacy/uninstall_task.cc
+++ b/paludis/legacy/uninstall_task.cc
@@ -209,7 +209,7 @@ UninstallTask::add_target(const std::string & target)
_imp->had_set_targets = true;
std::shared_ptr<const SetSpecTree> spec(_imp->env->set(SetName(target)));
- DepSpecFlattener<SetSpecTree, PackageDepSpec> f(_imp->env);
+ DepSpecFlattener<SetSpecTree, PackageDepSpec> f(_imp->env, make_null_shared_ptr());
spec->top()->accept(f);
std::copy(f.begin(), f.end(), std::back_inserter(_imp->targets));
}