aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-05 12:40:09 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-05 12:40:09 +0100
commit9cd5d50a2d35588d0659a9df384340827954fd9d (patch)
treeb1ff12d71bdfb1f3e3dbde191b8b3eb677c75b41
parent15946c2ee45cb169c0e85da18f4cccc4fad3ca8c (diff)
downloadpaludis-9cd5d50a2d35588d0659a9df384340827954fd9d.tar.gz
paludis-9cd5d50a2d35588d0659a9df384340827954fd9d.tar.xz
Gentoo QA is a lost cause
-rw-r--r--paludis/elike_conditional_dep_spec.cc4
-rw-r--r--paludis/elike_package_dep_spec.se1
-rw-r--r--paludis/elike_use_requirement.cc41
-rw-r--r--paludis/elike_use_requirement.se1
-rw-r--r--paludis/repositories/e/dep_parser.cc44
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf3
6 files changed, 54 insertions, 40 deletions
diff --git a/paludis/elike_conditional_dep_spec.cc b/paludis/elike_conditional_dep_spec.cc
index 18ba90a..7134dac 100644
--- a/paludis/elike_conditional_dep_spec.cc
+++ b/paludis/elike_conditional_dep_spec.cc
@@ -61,7 +61,7 @@ namespace
if (! no_warning_for_unlisted)
if (! id.choices_key()->value()->has_matching_contains_every_value_prefix(f))
- Log::get_instance()->message("elike_use_requirement.query", ll_warning, lc_context) <<
+ Log::get_instance()->message("elike_conditional_dep_spec.query", ll_warning, lc_context) <<
"ID '" << id << "' has no flag named '" << f << "'";
return false;
}
@@ -81,7 +81,7 @@ namespace
if (! no_warning_for_unlisted)
if (! id.choices_key()->value()->has_matching_contains_every_value_prefix(f))
- Log::get_instance()->message("elike_use_requirement.query", ll_warning, lc_context) <<
+ Log::get_instance()->message("elike_conditional_dep_spec.query", ll_warning, lc_context) <<
"ID '" << id << "' has no flag named '" << f << "'";
return false;
}
diff --git a/paludis/elike_package_dep_spec.se b/paludis/elike_package_dep_spec.se
index 3746241..ad244d1 100644
--- a/paludis/elike_package_dep_spec.se
+++ b/paludis/elike_package_dep_spec.se
@@ -14,6 +14,7 @@ make_enum_ELikePackageDepSpecOption()
key epdso_allow_use_deps_portage "Allow [use] deps with Portage syntax"
key epdso_allow_use_dep_defaults "Allow [use(+)] and [use(-)] deps"
key epdso_allow_use_dep_question_defaults "Allow [use(?)] deps"
+ key epdso_missing_use_deps_is_qa "Missing [use] flags with no default is a QA violation"
key epdso_allow_ranged_deps "Allow [op version] deps"
key epdso_allow_tilde_greater_deps "Allow ~> deps"
key epdso_disallow_nonranged_deps "Disallow >=foo/bar-1 deps"
diff --git a/paludis/elike_use_requirement.cc b/paludis/elike_use_requirement.cc
index 12c4b45..a643ed7 100644
--- a/paludis/elike_use_requirement.cc
+++ b/paludis/elike_use_requirement.cc
@@ -41,7 +41,9 @@ using namespace paludis;
namespace
{
- bool icky_use_query(const ChoiceNameWithPrefix & f,
+ bool icky_use_query(
+ const ELikeUseRequirementOptions & options,
+ const ChoiceNameWithPrefix & f,
const PackageID & id,
const ChangedChoices * const changed_choices,
Tribool default_value = Tribool(indeterminate))
@@ -64,8 +66,9 @@ namespace
if (v)
return v->enabled();
- if (default_value.is_indeterminate() && ! id.choices_key()->value()->has_matching_contains_every_value_prefix(f))
- Log::get_instance()->message("elike_use_requirement.query", ll_warning, lc_context) <<
+ if (default_value.is_indeterminate() && ! id.choices_key()->value()->has_matching_contains_every_value_prefix(f) &&
+ options[euro_missing_is_qa])
+ Log::get_instance()->message("elike_use_requirement.query", ll_qa, lc_context) <<
"ID '" << id << "' has no flag named '" << f << "'";
return default_value.is_true();
}
@@ -75,18 +78,20 @@ namespace
private:
const std::string _flags;
const std::shared_ptr<const PackageID> _id;
- const ELikeUseRequirementOptions _options;
const Tribool _default_value;
const bool _ignore_if_no_such_group;
+ protected:
+ const ELikeUseRequirementOptions _options;
+
public:
UseRequirement(const std::string & n, const std::shared_ptr<const PackageID> & i,
const ELikeUseRequirementOptions & o, Tribool d, const bool g) :
_flags(n),
_id(i),
- _options(o),
_default_value(d),
- _ignore_if_no_such_group(g)
+ _ignore_if_no_such_group(g),
+ _options(o)
{
}
@@ -252,7 +257,7 @@ namespace
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag, const ChangedChoices * const,
const PackageID & pkg, const ChangedChoices * const changed_choices) const
{
- return icky_use_query(flag, pkg, changed_choices, default_value());
+ return icky_use_query(_options, flag, pkg, changed_choices, default_value());
}
virtual const std::string as_human_string() const
@@ -276,7 +281,7 @@ namespace
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag, const ChangedChoices * const,
const PackageID & pkg, const ChangedChoices * const changed_choices) const
{
- return ! icky_use_query(flag, pkg, changed_choices, default_value());
+ return ! icky_use_query(_options, flag, pkg, changed_choices, default_value());
}
virtual const std::string as_human_string() const
@@ -314,7 +319,8 @@ namespace
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag,
const ChangedChoices * const maybe_changes_to_owner, const PackageID & pkg, const ChangedChoices * const changed_choices) const
{
- return ! icky_use_query(flag, *package_id(), maybe_changes_to_owner) || icky_use_query(flag, pkg, changed_choices, default_value());
+ return ! icky_use_query(_options, flag, *package_id(), maybe_changes_to_owner) ||
+ icky_use_query(_options, flag, pkg, changed_choices, default_value());
}
virtual const std::string as_human_string() const
@@ -339,7 +345,8 @@ namespace
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag,
const ChangedChoices * const maybe_changes_to_owner, const PackageID & pkg, const ChangedChoices * const changed_choices) const
{
- return icky_use_query(flag, *package_id(), maybe_changes_to_owner) || icky_use_query(flag, pkg, changed_choices, default_value());
+ return icky_use_query(_options, flag, *package_id(), maybe_changes_to_owner) ||
+ icky_use_query(_options, flag, pkg, changed_choices, default_value());
}
virtual const std::string as_human_string() const
@@ -364,8 +371,8 @@ namespace
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag,
const ChangedChoices * const maybe_changes_to_owner, const PackageID & pkg, const ChangedChoices * const changed_choices) const
{
- return ! icky_use_query(flag, *package_id(), maybe_changes_to_owner) ||
- ! icky_use_query(flag, pkg, changed_choices, default_value());
+ return ! icky_use_query(_options, flag, *package_id(), maybe_changes_to_owner) ||
+ ! icky_use_query(_options, flag, pkg, changed_choices, default_value());
}
virtual const std::string as_human_string() const
@@ -390,8 +397,8 @@ namespace
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag,
const ChangedChoices * const maybe_changes_to_owner, const PackageID & pkg, const ChangedChoices * const changed_choices) const
{
- return icky_use_query(flag, *package_id(), maybe_changes_to_owner) ||
- ! icky_use_query(flag, pkg, changed_choices, default_value());
+ return icky_use_query(_options, flag, *package_id(), maybe_changes_to_owner) ||
+ ! icky_use_query(_options, flag, pkg, changed_choices, default_value());
}
virtual const std::string as_human_string() const
@@ -416,7 +423,8 @@ namespace
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag,
const ChangedChoices * const maybe_changes_to_owner, const PackageID & pkg, const ChangedChoices * const changed_choices) const
{
- return icky_use_query(flag, pkg, changed_choices, default_value()) == icky_use_query(flag, *package_id(), maybe_changes_to_owner);
+ return icky_use_query(_options, flag, pkg, changed_choices, default_value()) ==
+ icky_use_query(_options, flag, *package_id(), maybe_changes_to_owner);
}
virtual const std::string as_human_string() const
@@ -441,7 +449,8 @@ namespace
virtual bool one_requirement_met_base(const Environment * const, const ChoiceNameWithPrefix & flag,
const ChangedChoices * const maybe_changes_to_owner, const PackageID & pkg, const ChangedChoices * const changed_choices) const
{
- return icky_use_query(flag, pkg, changed_choices, default_value()) != icky_use_query(flag, *package_id(), maybe_changes_to_owner);
+ return icky_use_query(_options, flag, pkg, changed_choices, default_value()) !=
+ icky_use_query(_options, flag, *package_id(), maybe_changes_to_owner);
}
virtual const std::string as_human_string() const
diff --git a/paludis/elike_use_requirement.se b/paludis/elike_use_requirement.se
index 6099b88..c0c9d54 100644
--- a/paludis/elike_use_requirement.se
+++ b/paludis/elike_use_requirement.se
@@ -12,5 +12,6 @@ make_enum_ELikeUseRequirementOption()
key euro_portage_syntax "Parse using Portage syntax"
key euro_both_syntaxes "Accept both Portage and Paludis syntax"
key euro_strict_parsing "Error rather than warn for violations"
+ key euro_missing_is_qa "Missing flags with no default value is a QA violation"
}
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index ab225ac..5f083cc 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -262,10 +262,12 @@ namespace
typename ParseStackTypes<T_>::Stack & stack,
const std::string & u,
const Environment * const env,
- const std::shared_ptr<const PackageID> & id)
+ const std::shared_ptr<const PackageID> & id,
+ const EAPI & eapi)
{
std::shared_ptr<ConditionalDepSpec> spec(std::make_shared<ConditionalDepSpec>(parse_elike_conditional_dep_spec(
- u, env, id, bool(id->repository()->installed_root_key()))));
+ u, env, id,
+ bool(id->repository()->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
@@ -339,7 +341,7 @@ paludis::erepository::parse_depend(const std::string & s,
std::ref(stack),
ParseStackTypes<DependencySpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)),
- id, _1, eapi),
+ id, _1, std::cref(eapi)),
n::on_pop() = std::bind(&pop_handler<DependencySpecTree>, std::ref(stack),
ParseStackTypes<DependencySpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), s),
@@ -347,8 +349,8 @@ paludis::erepository::parse_depend(const std::string & s,
n::on_string() = std::bind(&package_or_block_dep_spec_string_handler<DependencySpecTree>, std::ref(stack),
ParseStackTypes<DependencySpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1, eapi, id),
- n::on_use() = std::bind(&use_handler<DependencySpecTree>, std::ref(stack), _1, env, id),
- n::on_use_under_any() = std::bind(&use_under_any_handler, s, eapi)
+ n::on_use() = std::bind(&use_handler<DependencySpecTree>, std::ref(stack), _1, env, id, std::cref(eapi)),
+ n::on_use_under_any() = std::bind(&use_under_any_handler, s, std::cref(eapi))
));
parse_elike_dependencies(s, callbacks);
@@ -385,9 +387,9 @@ paludis::erepository::parse_provide(const std::string & 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),
ParseStackTypes<DependencySpecTree>::AnnotationsGoHere(std::bind(
- &set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1, eapi, id),
- n::on_use() = std::bind(&use_handler<ProvideSpecTree>, std::ref(stack), _1, env, id),
- n::on_use_under_any() = std::bind(&use_under_any_handler, s, eapi)
+ &set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1, std::cref(eapi), id),
+ n::on_use() = std::bind(&use_handler<ProvideSpecTree>, std::ref(stack), _1, env, id, std::cref(eapi)),
+ n::on_use_under_any() = std::bind(&use_under_any_handler, s, std::cref(eapi))
));
parse_elike_dependencies(s, callbacks);
@@ -417,20 +419,20 @@ paludis::erepository::parse_fetchable_uri(const std::string & s,
n::on_any() = std::bind(&any_not_allowed_handler, s),
n::on_arrow() = std::bind(&arrow_handler<FetchableURISpecTree>, std::ref(stack),
ParseStackTypes<FetchableURISpecTree>::AnnotationsGoHere(std::bind(
- &set_thing_to_annotate, std::ref(thing_to_annotate), _1)), s, _1, _2, eapi),
+ &set_thing_to_annotate, std::ref(thing_to_annotate), _1)), s, _1, _2, std::cref(eapi)),
n::on_error() = std::bind(&error_handler, s, _1),
n::on_label() = std::bind(&fetchable_label_handler<FetchableURISpecTree>, std::ref(stack),
ParseStackTypes<FetchableURISpecTree>::AnnotationsGoHere(std::bind(
- &set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1, eapi),
+ &set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1, std::cref(eapi)),
n::on_pop() = std::bind(&pop_handler<FetchableURISpecTree>, std::ref(stack),
ParseStackTypes<FetchableURISpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), 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),
ParseStackTypes<FetchableURISpecTree>::AnnotationsGoHere(std::bind(
- &set_thing_to_annotate, std::ref(thing_to_annotate), _1)), s, _1, "", eapi),
- n::on_use() = std::bind(&use_handler<FetchableURISpecTree>, std::ref(stack), _1, env, id),
- n::on_use_under_any() = std::bind(&use_under_any_handler, s, eapi)
+ &set_thing_to_annotate, std::ref(thing_to_annotate), _1)), s, _1, "", std::cref(eapi)),
+ n::on_use() = std::bind(&use_handler<FetchableURISpecTree>, std::ref(stack), _1, env, id, std::cref(eapi)),
+ n::on_use_under_any() = std::bind(&use_under_any_handler, s, std::cref(eapi))
));
parse_elike_dependencies(s, callbacks);
@@ -440,7 +442,7 @@ paludis::erepository::parse_fetchable_uri(const std::string & s,
std::shared_ptr<SimpleURISpecTree>
paludis::erepository::parse_simple_uri(const std::string & s,
- const Environment * const env, const std::shared_ptr<const PackageID> & id, const EAPI &)
+ const Environment * const env, const std::shared_ptr<const PackageID> & id, const EAPI & eapi)
{
using namespace std::placeholders;
@@ -468,7 +470,7 @@ paludis::erepository::parse_simple_uri(const std::string & s,
n::on_string() = std::bind(&simple_uri_handler<SimpleURISpecTree>, std::ref(stack),
ParseStackTypes<SimpleURISpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _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, env, id, std::cref(eapi)),
n::on_use_under_any() = &do_nothing
));
@@ -507,8 +509,8 @@ paludis::erepository::parse_license(const std::string & s,
n::on_string() = std::bind(&license_handler<LicenseSpecTree>, std::ref(stack),
ParseStackTypes<LicenseSpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1),
- n::on_use() = std::bind(&use_handler<LicenseSpecTree>, std::ref(stack), _1, env, id),
- n::on_use_under_any() = std::bind(&use_under_any_handler, s, eapi)
+ n::on_use() = std::bind(&use_handler<LicenseSpecTree>, std::ref(stack), _1, env, id, std::cref(eapi)),
+ n::on_use_under_any() = std::bind(&use_under_any_handler, s, std::cref(eapi))
));
parse_elike_dependencies(s, callbacks);
@@ -518,7 +520,7 @@ paludis::erepository::parse_license(const std::string & s,
std::shared_ptr<PlainTextSpecTree>
paludis::erepository::parse_plain_text(const std::string & s,
- const Environment * const env, const std::shared_ptr<const PackageID> & id, const EAPI &)
+ const Environment * const env, const std::shared_ptr<const PackageID> & id, const EAPI & eapi)
{
using namespace std::placeholders;
@@ -546,7 +548,7 @@ paludis::erepository::parse_plain_text(const std::string & s,
n::on_string() = std::bind(&plain_text_handler<PlainTextSpecTree>, std::ref(stack),
ParseStackTypes<PlainTextSpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1),
- n::on_use() = std::bind(&use_handler<PlainTextSpecTree>, std::ref(stack), _1, env, id),
+ n::on_use() = std::bind(&use_handler<PlainTextSpecTree>, std::ref(stack), _1, env, id, std::cref(eapi)),
n::on_use_under_any() = &do_nothing
));
@@ -557,7 +559,7 @@ paludis::erepository::parse_plain_text(const std::string & s,
std::shared_ptr<PlainTextSpecTree>
paludis::erepository::parse_myoptions(const std::string & s,
- const Environment * const env, const std::shared_ptr<const PackageID> & id, const EAPI &)
+ const Environment * const env, const std::shared_ptr<const PackageID> & id, const EAPI & eapi)
{
using namespace std::placeholders;
@@ -587,7 +589,7 @@ paludis::erepository::parse_myoptions(const std::string & s,
n::on_string() = std::bind(&plain_text_handler<PlainTextSpecTree>, std::ref(stack),
ParseStackTypes<PlainTextSpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1),
- n::on_use() = std::bind(&use_handler<PlainTextSpecTree>, std::ref(stack), _1, env, id),
+ n::on_use() = std::bind(&use_handler<PlainTextSpecTree>, std::ref(stack), _1, env, id, std::cref(eapi)),
n::on_use_under_any() = &do_nothing
));
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 44a8914..96e8e24 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -9,7 +9,8 @@ is_pbin = false
package_dep_spec_parse_options = allow_slot_deps allow_use_deps \
allow_ranged_deps allow_tilde_greater_deps strict_parsing \
allow_slot_equal_deps allow_slot_star_deps allow_use_dep_defaults \
- nice_equal_star disallow_nonranged_deps allow_use_dep_question_defaults
+ nice_equal_star disallow_nonranged_deps allow_use_dep_question_defaults \
+ missing_use_deps_is_qa
dependency_spec_tree_parse_options = disallow_any_use uri_supports_arrow single_bang_block_is_hard
iuse_flag_parse_options = strict_parsing
version_spec_options = flexible_dashes flexible_dots ignore_case \