aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-11-03 14:12:43 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-11-03 14:12:43 +0000
commitc0b811f3266617e9baca5ef33b570a57220c74af (patch)
treeacb8442b8300a9e7b5b65daceef8f1c79a30bdbf
parent5dcb7428bed9f47e3a80f9b4370275673be036b9 (diff)
downloadpaludis-c0b811f3266617e9baca5ef33b570a57220c74af.tar.gz
paludis-c0b811f3266617e9baca5ef33b570a57220c74af.tar.xz
test USE flag is 'special' with 0-based EAPIs
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc2
-rw-r--r--paludis/repositories/e/e_installed_repository_id.hh2
-rw-r--r--paludis/repositories/e/e_key.cc33
-rw-r--r--paludis/repositories/e/e_repository_id.hh2
-rw-r--r--paludis/repositories/e/eapi-fwd.hh1
-rw-r--r--paludis/repositories/e/eapi.cc12
-rw-r--r--paludis/repositories/e/eapi.hh12
-rw-r--r--paludis/repositories/e/eapis/0.conf2
-rw-r--r--paludis/repositories/e/ebuild_id.cc9
-rw-r--r--paludis/repositories/e/ebuild_id.hh2
10 files changed, 59 insertions, 18 deletions
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 58d4582..9eeb980 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -940,7 +940,7 @@ EInstalledRepositoryID::contained_in_key() const
std::tr1::shared_ptr<ChoiceValue>
EInstalledRepositoryID::make_choice_value(const std::tr1::shared_ptr<const Choice> & c, const UnprefixedChoiceName & v,
- const Tribool, const bool explicitly_listed, const std::string & override_description) const
+ const Tribool, const bool explicitly_listed, const std::string & override_description, const bool) const
{
if (! eapi()->supported())
throw InternalError(PALUDIS_HERE, "Unsupported EAPI");
diff --git a/paludis/repositories/e/e_installed_repository_id.hh b/paludis/repositories/e/e_installed_repository_id.hh
index 41b003a..a156b25 100644
--- a/paludis/repositories/e/e_installed_repository_id.hh
+++ b/paludis/repositories/e/e_installed_repository_id.hh
@@ -105,7 +105,7 @@ namespace paludis
virtual std::tr1::shared_ptr<ChoiceValue> make_choice_value(
const std::tr1::shared_ptr<const Choice> &, const UnprefixedChoiceName &, const Tribool,
- const bool, const std::string &) const;
+ const bool, const std::string &, const bool) const;
virtual void add_build_options(const std::tr1::shared_ptr<Choices> &) const;
};
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index ccf3922..cbcc9fd 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -48,6 +48,7 @@
#include <paludis/stringify_formatter-impl.hh>
#include <paludis/dep_spec_flattener.hh>
#include <paludis/choice.hh>
+#include <paludis/elike_choices.hh>
#include <tr1/functional>
#include <list>
@@ -1019,7 +1020,7 @@ namespace
Log::get_instance()->message("e_key.myoptions.unknown", ll_qa, lc_context)
<< "Unknown annotation '" << a->first << "' = '" << a->second << "'";
}
- return id->make_choice_value(choice, v->first, s, b, description);
+ return id->make_choice_value(choice, v->first, s, b, description, false);
}
}
@@ -1050,6 +1051,8 @@ EChoicesKey::value() const
true));
_imp->value->add(use);
+ bool has_fancy_test_flag(false);
+
std::tr1::shared_ptr<const Set<std::string> > hidden;
if (_imp->id->raw_use_expand_hidden_key())
hidden = _imp->id->raw_use_expand_hidden_key()->value();
@@ -1122,8 +1125,13 @@ EChoicesKey::value() const
_imp->id->raw_use_expand_key()->value()->end(),
IsExpand(flag.first, delim)))
i_values.insert(flag);
+ else if (stringify(flag.first) == _imp->id->eapi()->supported()->choices_options()->fancy_test_flag())
+ {
+ /* have to add this right at the end, after build_options is there */
+ has_fancy_test_flag = true;
+ }
else
- use->add(_imp->id->make_choice_value(use, UnprefixedChoiceName(stringify(flag.first)), flag.second, true, ""));
+ use->add(_imp->id->make_choice_value(use, UnprefixedChoiceName(stringify(flag.first)), flag.second, true, "", false));
}
/* pain in the ass: installed packages with DEPEND="x86? ( blah )" need to work,
@@ -1151,7 +1159,7 @@ EChoicesKey::value() const
/* don't need to worry */
}
else
- use->add(_imp->id->make_choice_value(use, UnprefixedChoiceName(stringify(flag.first)), flag.second, false, ""));
+ use->add(_imp->id->make_choice_value(use, UnprefixedChoiceName(stringify(flag.first)), flag.second, false, "", false));
}
}
}
@@ -1164,7 +1172,7 @@ EChoicesKey::value() const
for (Set<UnprefixedChoiceName>::ConstIterator a(_imp->maybe_e_repository->arch_flags()->begin()), a_end(_imp->maybe_e_repository->arch_flags()->end()) ;
a != a_end ; ++a)
- arch->add(_imp->id->make_choice_value(arch, *a, indeterminate, false, ""));
+ arch->add(_imp->id->make_choice_value(arch, *a, indeterminate, false, "", false));
}
if (_imp->id->raw_use_expand_key())
@@ -1207,15 +1215,28 @@ EChoicesKey::value() const
{
std::map<ChoiceNameWithPrefix, Tribool>::const_iterator i(i_values.find(ChoiceNameWithPrefix(lower_u + delim + stringify(*v))));
if (i_values.end() != i)
- exp->add(_imp->id->make_choice_value(exp, *v, i->second, true, ""));
+ exp->add(_imp->id->make_choice_value(exp, *v, i->second, true, "", false));
else
- exp->add(_imp->id->make_choice_value(exp, *v, indeterminate, false, ""));
+ exp->add(_imp->id->make_choice_value(exp, *v, indeterminate, false, "", false));
}
}
}
}
_imp->id->add_build_options(_imp->value);
+
+ if (has_fancy_test_flag)
+ {
+ std::tr1::shared_ptr<const ChoiceValue> choice;
+
+ choice = _imp->value->find_by_name_with_prefix(ELikeRecommendedTestsChoiceValue::canonical_name_with_prefix());
+ if (! choice)
+ choice = _imp->value->find_by_name_with_prefix(ELikeOptionalTestsChoiceValue::canonical_name_with_prefix());
+ if (choice)
+ use->add(_imp->id->make_choice_value(use, UnprefixedChoiceName(_imp->id->eapi()->supported()->choices_options()->fancy_test_flag()),
+ choice->enabled(), true, "", true));
+ }
+
return _imp->value;
}
diff --git a/paludis/repositories/e/e_repository_id.hh b/paludis/repositories/e/e_repository_id.hh
index 4c0e75b..bffad35 100644
--- a/paludis/repositories/e/e_repository_id.hh
+++ b/paludis/repositories/e/e_repository_id.hh
@@ -47,7 +47,7 @@ namespace paludis
virtual std::tr1::shared_ptr<ChoiceValue> make_choice_value(
const std::tr1::shared_ptr<const Choice> &, const UnprefixedChoiceName &, const Tribool,
- const bool, const std::string &)
+ const bool, const std::string &, const bool)
const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual void add_build_options(const std::tr1::shared_ptr<Choices> &) const = 0;
diff --git a/paludis/repositories/e/eapi-fwd.hh b/paludis/repositories/e/eapi-fwd.hh
index c4c6fe3..27611bc 100644
--- a/paludis/repositories/e/eapi-fwd.hh
+++ b/paludis/repositories/e/eapi-fwd.hh
@@ -39,6 +39,7 @@ namespace paludis
class EAPILabels;
class EAPIToolsOptions;
class EAPIPipeCommands;
+ class EAPIChoicesOptions;
class EAPIEbuildEnvironmentVariables;
class SupportedEAPI;
class EAPI;
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 4d4d77b..d79b93d 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -217,6 +217,15 @@ namespace
)));
}
+ std::tr1::shared_ptr<const EAPIChoicesOptions> make_choices_options(const KeyValueConfigFile & k)
+ {
+ return make_shared_ptr(new EAPIChoicesOptions(make_named_values<EAPIChoicesOptions>(
+ value_for<n::fancy_test_flag>(check_get(k, "fancy_test_flag")),
+ value_for<n::has_optional_tests>(destringify_key<bool>(k, "has_optional_tests")),
+ value_for<n::has_recommended_tests>(destringify_key<bool>(k, "has_recommended_tests"))
+ )));
+ }
+
std::tr1::shared_ptr<const SupportedEAPI> make_supported_eapi(const KeyValueConfigFile & k)
{
ELikePackageDepSpecOptions package_dep_spec_parse_options;
@@ -263,14 +272,13 @@ namespace
value_for<n::annotations>(make_annotations(k)),
value_for<n::breaks_portage>(destringify_key<bool>(k, "breaks_portage")),
value_for<n::can_be_pbin>(destringify_key<bool>(k, "can_be_pbin")),
+ value_for<n::choices_options>(make_choices_options(k)),
value_for<n::dependency_labels>(make_shared_ptr(new const EAPILabels(check_get(k, "dependency_labels")))),
value_for<n::dependency_spec_tree_parse_options>(dependency_spec_tree_parse_options),
value_for<n::ebuild_environment_variables>(make_ebuild_environment_variables(k)),
value_for<n::ebuild_metadata_variables>(make_ebuild_metadata_variables(k)),
value_for<n::ebuild_options>(make_ebuild_options(k)),
value_for<n::ebuild_phases>(make_ebuild_phases(k)),
- value_for<n::has_optional_tests>(destringify_key<bool>(k, "has_optional_tests")),
- value_for<n::has_recommended_tests>(destringify_key<bool>(k, "has_recommended_tests")),
value_for<n::iuse_flag_parse_options>(iuse_flag_parse_options),
value_for<n::merger_options>(merger_options),
value_for<n::package_dep_spec_parse_options>(package_dep_spec_parse_options),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 1270b99..ebd575f 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -45,6 +45,7 @@ namespace paludis
struct bugs_to;
struct build_depend;
struct can_be_pbin;
+ struct choices_options;
struct dependencies;
struct dependency_labels;
struct dependency_spec_tree_parse_options;
@@ -91,6 +92,7 @@ namespace paludis
struct exported_name;
struct f_function_prefix;
struct failure_is_fatal;
+ struct fancy_test_flag;
struct flat_list_index;
struct has_optional_tests;
struct has_recommended_tests;
@@ -224,14 +226,13 @@ namespace paludis
NamedValue<n::annotations, std::tr1::shared_ptr<const EAPIAnnotations> > annotations;
NamedValue<n::breaks_portage, bool> breaks_portage;
NamedValue<n::can_be_pbin, bool> can_be_pbin;
+ NamedValue<n::choices_options, std::tr1::shared_ptr<const EAPIChoicesOptions> > choices_options;
NamedValue<n::dependency_labels, std::tr1::shared_ptr<const EAPILabels> > dependency_labels;
NamedValue<n::dependency_spec_tree_parse_options, erepository::DependencySpecTreeParseOptions> dependency_spec_tree_parse_options;
NamedValue<n::ebuild_environment_variables, std::tr1::shared_ptr<const EAPIEbuildEnvironmentVariables> > ebuild_environment_variables;
NamedValue<n::ebuild_metadata_variables, std::tr1::shared_ptr<const EAPIEbuildMetadataVariables> > ebuild_metadata_variables;
NamedValue<n::ebuild_options, std::tr1::shared_ptr<const EAPIEbuildOptions> > ebuild_options;
NamedValue<n::ebuild_phases, std::tr1::shared_ptr<const EAPIEbuildPhases> > ebuild_phases;
- NamedValue<n::has_optional_tests, bool> has_optional_tests;
- NamedValue<n::has_recommended_tests, bool> has_recommended_tests;
NamedValue<n::iuse_flag_parse_options, IUseFlagParseOptions> iuse_flag_parse_options;
NamedValue<n::merger_options, MergerOptions> merger_options;
NamedValue<n::package_dep_spec_parse_options, ELikePackageDepSpecOptions> package_dep_spec_parse_options;
@@ -241,6 +242,13 @@ namespace paludis
NamedValue<n::userpriv_cannot_use_root, bool> userpriv_cannot_use_root;
};
+ struct EAPIChoicesOptions
+ {
+ NamedValue<n::fancy_test_flag, std::string> fancy_test_flag;
+ NamedValue<n::has_optional_tests, bool> has_optional_tests;
+ NamedValue<n::has_recommended_tests, bool> has_recommended_tests;
+ };
+
struct EAPIEbuildEnvironmentVariables
{
NamedValue<n::description_choices, std::string> description_choices;
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 408fcc3..6f5f803 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -21,8 +21,10 @@ f_function_prefix = ebuild_f
ignore_pivot_env_functions =
ignore_pivot_env_variables =
userpriv_cannot_use_root = false
+
has_optional_tests = true
has_recommended_tests = false
+fancy_test_flag = test
vdb_from_env_variables = \
CATEGORY CHOST COUNTER DEPEND DESCRIPTION EAPI FEATURES \
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 7cba9c1..5f05f9e 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1098,7 +1098,8 @@ EbuildID::make_choice_value(
const UnprefixedChoiceName & value_name,
const Tribool iuse_default,
const bool explicitly_listed,
- const std::string & override_description
+ const std::string & override_description,
+ const bool force_locked
) const
{
if (! eapi()->supported())
@@ -1159,7 +1160,7 @@ EbuildID::make_choice_value(
return make_shared_ptr(new EChoiceValue(choice->prefix(), value_name, ChoiceNameWithPrefix(name_with_prefix), name(),
_imp->repository->use_desc(),
- enabled, enabled_by_default, locked, explicitly_listed, override_description));
+ enabled, enabled_by_default, force_locked || locked, explicitly_listed, override_description));
}
void
@@ -1170,9 +1171,9 @@ EbuildID::add_build_options(const std::tr1::shared_ptr<Choices> & choices) const
std::tr1::shared_ptr<Choice> build_options(new Choice(canonical_build_options_raw_name(), canonical_build_options_human_name(),
canonical_build_options_prefix(), false, false, false, false));
choices->add(build_options);
- if (eapi()->supported()->has_optional_tests())
+ if (eapi()->supported()->choices_options()->has_optional_tests())
build_options->add(make_shared_ptr(new ELikeOptionalTestsChoiceValue(shared_from_this(), _imp->environment, build_options)));
- if (eapi()->supported()->has_recommended_tests())
+ if (eapi()->supported()->choices_options()->has_recommended_tests())
build_options->add(make_shared_ptr(new ELikeRecommendedTestsChoiceValue(shared_from_this(), _imp->environment, build_options)));
build_options->add(make_shared_ptr(new ELikeSplitChoiceValue(shared_from_this(), _imp->environment, build_options)));
build_options->add(make_shared_ptr(new ELikeStripChoiceValue(shared_from_this(), _imp->environment, build_options)));
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index 47d99b0..a76a063 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -144,7 +144,7 @@ namespace paludis
virtual std::tr1::shared_ptr<ChoiceValue> make_choice_value(
const std::tr1::shared_ptr<const Choice> &, const UnprefixedChoiceName &, const Tribool,
- const bool, const std::string &) const;
+ const bool, const std::string &, const bool) const;
virtual void add_build_options(const std::tr1::shared_ptr<Choices> &) const;
};