aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-28 22:19:20 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-01 03:57:52 +0000
commit92f0a95d1854442e744f707eaae9add7fd92ff67 (patch)
tree9d403328a07f89c1598b4d3cb0079b292d82729e /paludis/repositories
parent092228a814cd6700b97112b5dcf931c80b6b9431 (diff)
downloadpaludis-92f0a95d1854442e744f707eaae9add7fd92ff67.tar.gz
paludis-92f0a95d1854442e744f707eaae9add7fd92ff67.tar.xz
Pass env, id to ConditionalDepSpec members
Diffstat (limited to 'paludis/repositories')
-rw-r--r--paludis/repositories/cran/package_dep_spec.cc5
-rw-r--r--paludis/repositories/e/a_finder.cc2
-rw-r--r--paludis/repositories/e/can_skip_phase.cc2
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.cc2
-rw-r--r--paludis/repositories/e/dep_parser.cc3
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.cc2
-rw-r--r--paludis/repositories/e/do_fetch_action.cc2
-rw-r--r--paludis/repositories/e/do_info_action.cc2
-rw-r--r--paludis/repositories/e/do_install_action.cc4
-rw-r--r--paludis/repositories/e/do_pretend_action.cc2
-rw-r--r--paludis/repositories/e/e_key.cc2
-rw-r--r--paludis/repositories/e/e_repository.cc2
-rw-r--r--paludis/repositories/e/ebuild_id.cc2
-rw-r--r--paludis/repositories/e/fetch_visitor.cc2
-rw-r--r--paludis/repositories/e/myoptions_requirements_verifier.cc2
-rw-r--r--paludis/repositories/e/pretend_fetch_visitor.cc2
-rw-r--r--paludis/repositories/e/required_use_verifier.cc2
-rw-r--r--paludis/repositories/e/vdb_repository.cc2
-rw-r--r--paludis/repositories/fake/dep_parser.cc25
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc2
-rw-r--r--paludis/repositories/fake/fake_package_id.cc2
21 files changed, 32 insertions, 39 deletions
diff --git a/paludis/repositories/cran/package_dep_spec.cc b/paludis/repositories/cran/package_dep_spec.cc
index 6c8e5550e..2afa19dd1 100644
--- a/paludis/repositories/cran/package_dep_spec.cc
+++ b/paludis/repositories/cran/package_dep_spec.cc
@@ -114,11 +114,6 @@ namespace
return std::shared_ptr<const AdditionalPackageDepSpecRequirements>();
}
- virtual std::shared_ptr<const MetadataSectionKey> annotations_key() const
- {
- return std::shared_ptr<const MetadataSectionKey>();
- }
-
CRANPackageDepSpecData & version_requirement(const VersionRequirement & v)
{
if (! version_requirements_v)
diff --git a/paludis/repositories/e/a_finder.cc b/paludis/repositories/e/a_finder.cc
index 956d3e164..b4c9a552a 100644
--- a/paludis/repositories/e/a_finder.cc
+++ b/paludis/repositories/e/a_finder.cc
@@ -55,7 +55,7 @@ AFinder::visit(const FetchableURISpecTree::NodeType<AllDepSpec>::Type & node)
void
AFinder::visit(const FetchableURISpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
- if (node.spec()->condition_met())
+ if (node.spec()->condition_met(env, id))
{
_labels.push_front(*_labels.begin());
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
diff --git a/paludis/repositories/e/can_skip_phase.cc b/paludis/repositories/e/can_skip_phase.cc
index 0aa79efd1..9fc3e5f85 100644
--- a/paludis/repositories/e/can_skip_phase.cc
+++ b/paludis/repositories/e/can_skip_phase.cc
@@ -54,7 +54,7 @@ namespace
void visit(const FetchableURISpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
- if (node.spec()->condition_met())
+ if (node.spec()->condition_met(env, package_id))
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
}
diff --git a/paludis/repositories/e/check_fetched_files_visitor.cc b/paludis/repositories/e/check_fetched_files_visitor.cc
index 94c5a92b8..a95db2d20 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.cc
+++ b/paludis/repositories/e/check_fetched_files_visitor.cc
@@ -130,7 +130,7 @@ void
CheckFetchedFilesVisitor::visit(const FetchableURISpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
Save<bool> save_in_nofetch(&_imp->in_nofetch, _imp->in_nofetch);
- if ((_imp->check_unneeded) || (node.spec()->condition_met()))
+ if ((_imp->check_unneeded) || (node.spec()->condition_met(_imp->env, _imp->id)))
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
}
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 14b06d9e1..c518c137d 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -304,8 +304,7 @@ namespace
{
auto repo(env->package_database()->fetch_repository(id->repository_name()));
std::shared_ptr<ConditionalDepSpec> spec(std::make_shared<ConditionalDepSpec>(parse_elike_conditional_dep_spec(
- u, env, id,
- bool(repo->installed_root_key()) || ! eapi.supported()->package_dep_spec_parse_options()[epdso_missing_use_deps_is_qa])));
+ u, bool(repo->installed_root_key()) || ! eapi.supported()->package_dep_spec_parse_options()[epdso_missing_use_deps_is_qa])));
stack.push_front(make_named_values<typename ParseStackTypes<T_>::Item>(
n::item() = stack.begin()->item()->append(spec),
n::spec() = spec
diff --git a/paludis/repositories/e/dep_spec_pretty_printer.cc b/paludis/repositories/e/dep_spec_pretty_printer.cc
index 351be3250..6d64f0c83 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer.cc
@@ -319,7 +319,7 @@ DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<ConditionalDepSpec>:
if (! _imp->check_conditions)
_imp->s << _imp->formatter.format(*node.spec(), format::Plain()) << " (";
- else if (node.spec()->condition_met())
+ else if (node.spec()->condition_met(_imp->env, _imp->id))
_imp->s << _imp->formatter.format(*node.spec(), format::Enabled()) << " (";
else
_imp->s << _imp->formatter.format(*node.spec(), format::Disabled()) << " (";
diff --git a/paludis/repositories/e/do_fetch_action.cc b/paludis/repositories/e/do_fetch_action.cc
index 984b6688e..46ac11803 100644
--- a/paludis/repositories/e/do_fetch_action.cc
+++ b/paludis/repositories/e/do_fetch_action.cc
@@ -57,7 +57,7 @@ paludis::erepository::do_fetch_action(
bool fetch_restrict(false), userpriv_restrict(false);
{
- DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env);
+ DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env, id);
if (id->restrict_key())
id->restrict_key()->value()->top()->accept(restricts);
diff --git a/paludis/repositories/e/do_info_action.cc b/paludis/repositories/e/do_info_action.cc
index a2bacb0b4..54d4f70e0 100644
--- a/paludis/repositories/e/do_info_action.cc
+++ b/paludis/repositories/e/do_info_action.cc
@@ -51,7 +51,7 @@ paludis::erepository::do_info_action(
bool userpriv_restrict;
{
- DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env);
+ DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env, id);
if (id->restrict_key())
id->restrict_key()->value()->top()->accept(restricts);
diff --git a/paludis/repositories/e/do_install_action.cc b/paludis/repositories/e/do_install_action.cc
index 9ef703749..03aca3011 100644
--- a/paludis/repositories/e/do_install_action.cc
+++ b/paludis/repositories/e/do_install_action.cc
@@ -74,7 +74,7 @@ namespace
void visit(const LicenseSpecTree::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));
}
@@ -127,7 +127,7 @@ paludis::erepository::do_install_action(
bool userpriv_restrict, test_restrict, strip_restrict;
{
- DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env);
+ DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env, id);
if (id->restrict_key())
id->restrict_key()->value()->top()->accept(restricts);
diff --git a/paludis/repositories/e/do_pretend_action.cc b/paludis/repositories/e/do_pretend_action.cc
index 2bc4d04b5..d55fc8f19 100644
--- a/paludis/repositories/e/do_pretend_action.cc
+++ b/paludis/repositories/e/do_pretend_action.cc
@@ -60,7 +60,7 @@ paludis::erepository::do_pretend_action(
bool userpriv_restrict;
{
- DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env);
+ DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env, id);
if (id->restrict_key())
id->restrict_key()->value()->top()->accept(restricts);
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 8912e52c9..61bef825b 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -367,7 +367,7 @@ EFetchableURIKey::initial_label() const
if (! _imp->initial_label)
{
- DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> f(_imp->env);
+ DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> f(_imp->env, _imp->id);
if (_imp->id->restrict_key())
_imp->id->restrict_key()->value()->top()->accept(f);
for (DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec>::ConstIterator i(f.begin()), i_end(f.end()) ;
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 32e1c3e06..d880933be 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -1799,7 +1799,7 @@ ERepository::get_environment_variable(
{
using namespace std::placeholders;
- DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(_imp->params.environment());
+ DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(_imp->params.environment(), id_uncasted);
if (id->restrict_key())
id->restrict_key()->value()->top()->accept(restricts);
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 50c077fd0..54a9756f7 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -488,7 +488,7 @@ namespace
void visit(const LicenseSpecTree::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/repositories/e/fetch_visitor.cc b/paludis/repositories/e/fetch_visitor.cc
index e63a510ab..bdf7dc93f 100644
--- a/paludis/repositories/e/fetch_visitor.cc
+++ b/paludis/repositories/e/fetch_visitor.cc
@@ -117,7 +117,7 @@ FetchVisitor::~FetchVisitor()
void
FetchVisitor::visit(const FetchableURISpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
- if ((_imp->fetch_unneeded) || (node.spec()->condition_met()))
+ if ((_imp->fetch_unneeded) || (node.spec()->condition_met(_imp->env, _imp->id)))
{
_imp->labels.push_front(* _imp->labels.begin());
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
diff --git a/paludis/repositories/e/myoptions_requirements_verifier.cc b/paludis/repositories/e/myoptions_requirements_verifier.cc
index 6ba7099e4..be53f2674 100644
--- a/paludis/repositories/e/myoptions_requirements_verifier.cc
+++ b/paludis/repositories/e/myoptions_requirements_verifier.cc
@@ -254,7 +254,7 @@ MyOptionsRequirementsVerifier::visit(const PlainTextSpecTree::NodeType<PlainText
void
MyOptionsRequirementsVerifier::visit(const PlainTextSpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
- if (node.spec()->condition_met())
+ if (node.spec()->condition_met(_imp->env, _imp->id))
{
_imp->current_prefix_stack.push_front(*_imp->current_prefix_stack.begin());
_imp->current_children_stack.push_front(ChildrenList());
diff --git a/paludis/repositories/e/pretend_fetch_visitor.cc b/paludis/repositories/e/pretend_fetch_visitor.cc
index 955340a93..90855f1ba 100644
--- a/paludis/repositories/e/pretend_fetch_visitor.cc
+++ b/paludis/repositories/e/pretend_fetch_visitor.cc
@@ -99,7 +99,7 @@ PretendFetchVisitor::~PretendFetchVisitor()
void
PretendFetchVisitor::visit(const FetchableURISpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
- if ((_imp->fetch_unneeded) || (node.spec()->condition_met()))
+ if ((_imp->fetch_unneeded) || (node.spec()->condition_met(_imp->env, _imp->id)))
{
_imp->labels.push_front(* _imp->labels.begin());
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
diff --git a/paludis/repositories/e/required_use_verifier.cc b/paludis/repositories/e/required_use_verifier.cc
index f39633007..3dc58edf9 100644
--- a/paludis/repositories/e/required_use_verifier.cc
+++ b/paludis/repositories/e/required_use_verifier.cc
@@ -178,7 +178,7 @@ RequiredUseVerifier::visit(const RequiredUseSpecTree::NodeType<ExactlyOneDepSpec
void
RequiredUseVerifier::visit(const RequiredUseSpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
- if (! node.spec()->condition_met())
+ if (! node.spec()->condition_met(_imp->env, _imp->id))
return;
_imp->stack.push_front(Met{0, false});
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index e9e7511b1..c6c7b2867 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -714,7 +714,7 @@ VDBRepository::provides_from_package_id(const std::shared_ptr<const PackageID> &
return;
std::shared_ptr<const ProvideSpecTree> provide(id->provide_key()->value());
- DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(_imp->params.environment());
+ DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(_imp->params.environment(), id);
provide->top()->accept(f);
std::shared_ptr<std::list<QualifiedPackageName> > qpns(std::make_shared<std::list<QualifiedPackageName>>());
diff --git a/paludis/repositories/fake/dep_parser.cc b/paludis/repositories/fake/dep_parser.cc
index 806115edd..00330889f 100644
--- a/paludis/repositories/fake/dep_parser.cc
+++ b/paludis/repositories/fake/dep_parser.cc
@@ -139,11 +139,10 @@ namespace
}
template <typename T_>
- void use_handler(typename ParseStackTypes<T_>::Stack & stack, const std::string & u,
- const Environment * const env, const std::shared_ptr<const PackageID> & id)
+ void use_handler(typename ParseStackTypes<T_>::Stack & stack, const std::string & u)
{
stack.push_front((*stack.begin())->append(
- std::make_shared<ConditionalDepSpec>(parse_elike_conditional_dep_spec(u, env, id, false))));
+ std::make_shared<ConditionalDepSpec>(parse_elike_conditional_dep_spec(u, false))));
}
template <typename T_>
@@ -172,7 +171,7 @@ namespace
std::shared_ptr<DependencySpecTree>
paludis::fakerepository::parse_depend(const std::string & s,
- const Environment * const env, const std::shared_ptr<const PackageID> & id)
+ const Environment * const, const std::shared_ptr<const PackageID> & id)
{
using namespace std::placeholders;
@@ -192,7 +191,7 @@ paludis::fakerepository::parse_depend(const std::string & s,
n::on_pop() = std::bind(&pop_handler<DependencySpecTree>, std::ref(stack), s),
n::on_should_be_empty() = std::bind(&should_be_empty_handler<DependencySpecTree>, std::ref(stack), s),
n::on_string() = std::bind(&package_or_block_dep_spec_string_handler<DependencySpecTree>, std::ref(stack), _1, id),
- n::on_use() = std::bind(&use_handler<DependencySpecTree>, std::ref(stack), _1, env, id),
+ n::on_use() = std::bind(&use_handler<DependencySpecTree>, std::ref(stack), _1),
n::on_use_under_any() = &do_nothing
));
@@ -203,7 +202,7 @@ paludis::fakerepository::parse_depend(const std::string & s,
std::shared_ptr<ProvideSpecTree>
paludis::fakerepository::parse_provide(const std::string & s,
- const Environment * const env, const std::shared_ptr<const PackageID> & id)
+ const Environment * const, const std::shared_ptr<const PackageID> & id)
{
using namespace std::placeholders;
@@ -223,7 +222,7 @@ paludis::fakerepository::parse_provide(const std::string & s,
n::on_pop() = std::bind(&pop_handler<ProvideSpecTree>, std::ref(stack), s),
n::on_should_be_empty() = std::bind(&should_be_empty_handler<ProvideSpecTree>, std::ref(stack), s),
n::on_string() = std::bind(&package_dep_spec_string_handler<ProvideSpecTree>, std::ref(stack), _1, id),
- n::on_use() = std::bind(&use_handler<ProvideSpecTree>, std::ref(stack), _1, env, id),
+ n::on_use() = std::bind(&use_handler<ProvideSpecTree>, std::ref(stack), _1),
n::on_use_under_any() = &do_nothing
));
@@ -234,7 +233,7 @@ paludis::fakerepository::parse_provide(const std::string & s,
std::shared_ptr<FetchableURISpecTree>
paludis::fakerepository::parse_fetchable_uri(const std::string & s,
- const Environment * const env, const std::shared_ptr<const PackageID> & id)
+ const Environment * const, const std::shared_ptr<const PackageID> &)
{
using namespace std::placeholders;
@@ -254,7 +253,7 @@ paludis::fakerepository::parse_fetchable_uri(const std::string & s,
n::on_pop() = std::bind(&pop_handler<FetchableURISpecTree>, std::ref(stack), s),
n::on_should_be_empty() = std::bind(&should_be_empty_handler<FetchableURISpecTree>, std::ref(stack), s),
n::on_string() = std::bind(&arrow_handler<FetchableURISpecTree>, std::ref(stack), _1, ""),
- n::on_use() = std::bind(&use_handler<FetchableURISpecTree>, std::ref(stack), _1, env, id),
+ n::on_use() = std::bind(&use_handler<FetchableURISpecTree>, std::ref(stack), _1),
n::on_use_under_any() = &do_nothing
));
@@ -265,7 +264,7 @@ paludis::fakerepository::parse_fetchable_uri(const std::string & s,
std::shared_ptr<SimpleURISpecTree>
paludis::fakerepository::parse_simple_uri(const std::string & s,
- const Environment * const env, const std::shared_ptr<const PackageID> & id)
+ const Environment * const, const std::shared_ptr<const PackageID> &)
{
using namespace std::placeholders;
@@ -285,7 +284,7 @@ paludis::fakerepository::parse_simple_uri(const std::string & s,
n::on_pop() = std::bind(&pop_handler<SimpleURISpecTree>, std::ref(stack), s),
n::on_should_be_empty() = std::bind(&should_be_empty_handler<SimpleURISpecTree>, std::ref(stack), s),
n::on_string() = std::bind(&simple_uri_handler<SimpleURISpecTree>, std::ref(stack), _1),
- n::on_use() = std::bind(&use_handler<SimpleURISpecTree>, std::ref(stack), _1, env, id),
+ n::on_use() = std::bind(&use_handler<SimpleURISpecTree>, std::ref(stack), _1),
n::on_use_under_any() = &do_nothing
));
@@ -296,7 +295,7 @@ paludis::fakerepository::parse_simple_uri(const std::string & s,
std::shared_ptr<LicenseSpecTree>
paludis::fakerepository::parse_license(const std::string & s,
- const Environment * const env, const std::shared_ptr<const PackageID> & id)
+ const Environment * const, const std::shared_ptr<const PackageID> &)
{
using namespace std::placeholders;
@@ -316,7 +315,7 @@ paludis::fakerepository::parse_license(const std::string & s,
n::on_pop() = std::bind(&pop_handler<LicenseSpecTree>, std::ref(stack), s),
n::on_should_be_empty() = std::bind(&should_be_empty_handler<LicenseSpecTree>, std::ref(stack), s),
n::on_string() = std::bind(&license_handler<LicenseSpecTree>, std::ref(stack), _1),
- n::on_use() = std::bind(&use_handler<LicenseSpecTree>, std::ref(stack), _1, env, id),
+ n::on_use() = std::bind(&use_handler<LicenseSpecTree>, std::ref(stack), _1),
n::on_use_under_any() = &do_nothing
));
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index aea4dc9bb..9beb2402c 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -103,7 +103,7 @@ FakeInstalledRepository::provided_packages() const
if (! (*v)->provide_key())
continue;
- DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(environment());
+ DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(environment(), *v);
(*v)->provide_key()->value()->top()->accept(f);
for (DepSpecFlattener<ProvideSpecTree, PackageDepSpec>::ConstIterator q(f.begin()), q_end(f.end()) ; q != q_end ; ++q)
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index d1f6f6231..3dea04138 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -1115,7 +1115,7 @@ namespace
void visit(const LicenseSpecTree::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));
}