aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-08-06 22:53:19 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-08-06 22:53:19 +0100
commitf4136ef1d6b8bcb2bf1ce5c0a418b29961dc7948 (patch)
tree417de39a29d82a06b3f4e58b4f072106a296a286
parent34329461d843a53ba011a13b23a524624920d6ae (diff)
downloadpaludis-f4136ef1d6b8bcb2bf1ce5c0a418b29961dc7948.tar.gz
paludis-f4136ef1d6b8bcb2bf1ce5c0a418b29961dc7948.tar.xz
Don't allow queries on co_special things
-rw-r--r--paludis/elike_conditional_dep_spec.cc5
-rw-r--r--paludis/elike_use_requirement.cc5
-rw-r--r--paludis/repositories/e/required_use_verifier.cc2
3 files changed, 11 insertions, 1 deletions
diff --git a/paludis/elike_conditional_dep_spec.cc b/paludis/elike_conditional_dep_spec.cc
index dbb71eb..4b9fe30 100644
--- a/paludis/elike_conditional_dep_spec.cc
+++ b/paludis/elike_conditional_dep_spec.cc
@@ -58,7 +58,12 @@ namespace
auto choices(id.choices_key()->parse_value());
auto v(choices->find_by_name_with_prefix(f));
if (v)
+ {
+ if (co_special == v->origin())
+ Log::get_instance()->message("elike_conditional_dep_spec.query", ll_warning, lc_context) <<
+ "ID '" << id << "' flag '" << f << "' should not be used as a conditional";
return v->enabled();
+ }
if (! no_warning_for_unlisted)
if (! choices->has_matching_contains_every_value_prefix(f))
diff --git a/paludis/elike_use_requirement.cc b/paludis/elike_use_requirement.cc
index af891f4..1d2c305 100644
--- a/paludis/elike_use_requirement.cc
+++ b/paludis/elike_use_requirement.cc
@@ -65,7 +65,12 @@ namespace
auto choices(id->choices_key()->parse_value());
auto v(choices->find_by_name_with_prefix(f));
if (v)
+ {
+ if (co_special == v->origin())
+ Log::get_instance()->message("elike_use_requirement.query", ll_warning, lc_context) <<
+ "ID '" << *id << "' flag '" << f << "' should not be used as a conditional";
return v->enabled();
+ }
if (default_value.is_indeterminate() && ! choices->has_matching_contains_every_value_prefix(f) && options[euro_missing_is_qa])
Log::get_instance()->message("elike_use_requirement.query", ll_qa, lc_context) <<
diff --git a/paludis/repositories/e/required_use_verifier.cc b/paludis/repositories/e/required_use_verifier.cc
index cdac1ca..b965a06 100644
--- a/paludis/repositories/e/required_use_verifier.cc
+++ b/paludis/repositories/e/required_use_verifier.cc
@@ -93,7 +93,7 @@ RequiredUseVerifier::matches(const std::string & s)
}
auto c(_imp->id->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix(s)));
- if (! c)
+ if ((! c) || (co_special == c->origin()))
{
Log::get_instance()->message("e.required_use.no_choice", ll_warning, lc_context)
<< "ID '" << *_imp->id << "' has no choice named '" << s << "'', so cannot check that required use constraint '" << s << "' matches";