aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-08-31 20:19:38 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-08-31 20:36:53 +0100
commita12fcfad377089b874926a30c6d5ec03e5635e70 (patch)
tree6ad0773d0aa9f5f9dbf88bb0ab71a388b9b4e7a8
parentb7549573ecd777386e3944926c8b52d313e1b89c (diff)
downloadpaludis-a12fcfad377089b874926a30c6d5ec03e5635e70.tar.gz
paludis-a12fcfad377089b874926a30c6d5ec03e5635e70.tar.xz
Change how pbins do build_options: *tests
Fixes: ticket:1187
-rw-r--r--paludis/repositories/e/eapis/pbin-1+0.conf2
-rw-r--r--paludis/repositories/e/eapis/pbin-1+1.conf2
-rw-r--r--paludis/repositories/e/eapis/pbin-1+2.conf2
-rw-r--r--paludis/repositories/e/eapis/pbin-1+3.conf2
-rw-r--r--paludis/repositories/e/eapis/pbin-1+4.conf2
-rw-r--r--paludis/repositories/e/eapis/pbin-1+exheres-0.conf2
-rw-r--r--paludis/repositories/e/eapis/pbin-1+paludis-1.conf2
-rw-r--r--paludis/repositories/e/ebuild_id.cc79
8 files changed, 41 insertions, 52 deletions
diff --git a/paludis/repositories/e/eapis/pbin-1+0.conf b/paludis/repositories/e/eapis/pbin-1+0.conf
index c91518d..24e6526 100644
--- a/paludis/repositories/e/eapis/pbin-1+0.conf
+++ b/paludis/repositories/e/eapis/pbin-1+0.conf
@@ -7,8 +7,6 @@ is_pbin = true
ebuild_module_suffixes = pbin-1 ${ebuild_module_suffixes}
support_eclasses = false
-has_optional_tests = false
-has_recommended_tests = false
non_empty_variables = \
P PV PR PN PVR PF CATEGORY build:FILESDIR build:PORTDIR \
diff --git a/paludis/repositories/e/eapis/pbin-1+1.conf b/paludis/repositories/e/eapis/pbin-1+1.conf
index 8f09a26..50d90a1 100644
--- a/paludis/repositories/e/eapis/pbin-1+1.conf
+++ b/paludis/repositories/e/eapis/pbin-1+1.conf
@@ -7,8 +7,6 @@ is_pbin = true
ebuild_module_suffixes = pbin-1 ${ebuild_module_suffixes}
support_eclasses = false
-has_optional_tests = false
-has_recommended_tests = false
non_empty_variables = \
P PV PR PN PVR PF CATEGORY build:FILESDIR build:PORTDIR \
diff --git a/paludis/repositories/e/eapis/pbin-1+2.conf b/paludis/repositories/e/eapis/pbin-1+2.conf
index fedc4dd..1465a69 100644
--- a/paludis/repositories/e/eapis/pbin-1+2.conf
+++ b/paludis/repositories/e/eapis/pbin-1+2.conf
@@ -7,8 +7,6 @@ is_pbin = true
ebuild_module_suffixes = pbin-1 ${ebuild_module_suffixes}
support_eclasses = false
-has_optional_tests = false
-has_recommended_tests = false
non_empty_variables = \
P PV PR PN PVR PF CATEGORY build:FILESDIR build:PORTDIR \
diff --git a/paludis/repositories/e/eapis/pbin-1+3.conf b/paludis/repositories/e/eapis/pbin-1+3.conf
index 3515990..a6bc3da 100644
--- a/paludis/repositories/e/eapis/pbin-1+3.conf
+++ b/paludis/repositories/e/eapis/pbin-1+3.conf
@@ -7,8 +7,6 @@ is_pbin = true
ebuild_module_suffixes = pbin-1 ${ebuild_module_suffixes}
support_eclasses = false
-has_optional_tests = false
-has_recommended_tests = false
fix_mtimes = false
non_empty_variables = \
diff --git a/paludis/repositories/e/eapis/pbin-1+4.conf b/paludis/repositories/e/eapis/pbin-1+4.conf
index 7744458..e5822d3 100644
--- a/paludis/repositories/e/eapis/pbin-1+4.conf
+++ b/paludis/repositories/e/eapis/pbin-1+4.conf
@@ -7,8 +7,6 @@ is_pbin = true
ebuild_module_suffixes = pbin-1 ${ebuild_module_suffixes}
support_eclasses = false
-has_optional_tests = false
-has_recommended_tests = false
fix_mtimes = false
non_empty_variables = \
diff --git a/paludis/repositories/e/eapis/pbin-1+exheres-0.conf b/paludis/repositories/e/eapis/pbin-1+exheres-0.conf
index b555519..bce77ec 100644
--- a/paludis/repositories/e/eapis/pbin-1+exheres-0.conf
+++ b/paludis/repositories/e/eapis/pbin-1+exheres-0.conf
@@ -8,8 +8,6 @@ is_pbin = true
ebuild_module_suffixes = pbin-1 ${ebuild_module_suffixes}
support_exlibs = false
-has_optional_tests = false
-has_recommended_tests = false
fix_mtimes = false
non_empty_variables = \
diff --git a/paludis/repositories/e/eapis/pbin-1+paludis-1.conf b/paludis/repositories/e/eapis/pbin-1+paludis-1.conf
index 373914e..a496eff 100644
--- a/paludis/repositories/e/eapis/pbin-1+paludis-1.conf
+++ b/paludis/repositories/e/eapis/pbin-1+paludis-1.conf
@@ -8,8 +8,6 @@ is_pbin = true
ebuild_module_suffixes = pbin-1 ${ebuild_module_suffixes}
support_eclasses = false
-has_optional_tests = false
-has_recommended_tests = false
non_empty_variables = \
P PV PR PN PVR PF CATEGORY build:FILESDIR build:PORTDIR \
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 15eb875..7ca7239 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1569,9 +1569,10 @@ EbuildID::add_build_options(const std::shared_ptr<Choices> & choices) const
)));
choices->add(build_options);
+ bool mask_tests(false);
if (! eapi()->supported()->is_pbin())
{
- bool may_be_unrestricted_test(true), may_be_unrestricted_strip(true);
+ bool may_be_unrestricted_strip(true);
/* if we unconditionally restrict an action, don't add / force mask
* a build option for it. but if we conditionally restrict it, do,
@@ -1580,46 +1581,10 @@ EbuildID::add_build_options(const std::shared_ptr<Choices> & choices) const
{
UnconditionalRestrictFinder f;
restrict_key()->parse_value()->top()->accept(f);
- may_be_unrestricted_test = f.s.end() == f.s.find("test");
+ mask_tests = f.s.end() == f.s.find("test");
may_be_unrestricted_strip = f.s.end() == f.s.find("strip");
}
- /* optional_tests */
- if (eapi()->supported()->choices_options()->has_optional_tests())
- build_options->add(std::make_shared<ELikeOptionalTestsChoiceValue>(shared_from_this(), _imp->environment, build_options,
- ! may_be_unrestricted_test));
-
- /* recommended_tests */
- if (eapi()->supported()->choices_options()->has_recommended_tests())
- build_options->add(std::make_shared<ELikeRecommendedTestsChoiceValue>(shared_from_this(), _imp->environment, build_options,
- ! may_be_unrestricted_test));
-
- /* expensive_tests */
- if (eapi()->supported()->choices_options()->has_expensive_tests())
- {
- if (! _imp->defined_phases)
- throw InternalError(PALUDIS_HERE, "bug! no defined_phases yet");
-
- bool has_expensive_test_phase(false);
- EAPIPhases phases(_imp->eapi->supported()->ebuild_phases()->ebuild_install());
- for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
- phase != phase_end ; ++phase)
- {
- if (phase->option("expensive_tests"))
- {
- auto defined_phases(_imp->defined_phases->parse_value());
- if (defined_phases->end() != defined_phases->find(phase->equal_option("skipname")))
- {
- has_expensive_test_phase = true;
- break;
- }
- }
- }
-
- if (has_expensive_test_phase)
- build_options->add(std::make_shared<ELikeExpensiveTestsChoiceValue>(shared_from_this(), _imp->environment, build_options, false));
- }
-
/* symbols */
if (may_be_unrestricted_strip)
build_options->add(std::make_shared<ELikeSymbolsChoiceValue>(shared_from_this(), _imp->environment, build_options, last_escvp));
@@ -1634,6 +1599,44 @@ EbuildID::add_build_options(const std::shared_ptr<Choices> & choices) const
shared_from_this(), _imp->environment, build_options));
}
}
+ else
+ mask_tests = true;
+
+ /* optional_tests */
+ if (eapi()->supported()->choices_options()->has_optional_tests())
+ build_options->add(std::make_shared<ELikeOptionalTestsChoiceValue>(shared_from_this(), _imp->environment, build_options,
+ mask_tests));
+
+ /* recommended_tests */
+ if (eapi()->supported()->choices_options()->has_recommended_tests())
+ build_options->add(std::make_shared<ELikeRecommendedTestsChoiceValue>(shared_from_this(), _imp->environment, build_options,
+ mask_tests));
+
+ /* expensive_tests */
+ if (eapi()->supported()->choices_options()->has_expensive_tests())
+ {
+ if (! _imp->defined_phases)
+ throw InternalError(PALUDIS_HERE, "bug! no defined_phases yet");
+
+ bool has_expensive_test_phase(false);
+ EAPIPhases phases(_imp->eapi->supported()->ebuild_phases()->ebuild_install());
+ for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
+ phase != phase_end ; ++phase)
+ {
+ if (phase->option("expensive_tests"))
+ {
+ auto defined_phases(_imp->defined_phases->parse_value());
+ if (defined_phases->end() != defined_phases->find(phase->equal_option("skipname")))
+ {
+ has_expensive_test_phase = true;
+ break;
+ }
+ }
+ }
+
+ if (has_expensive_test_phase)
+ build_options->add(std::make_shared<ELikeExpensiveTestsChoiceValue>(shared_from_this(), _imp->environment, build_options, mask_tests));
+ }
/* trace */
build_options->add(std::make_shared<ELikeTraceChoiceValue>(