aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-01-03 23:19:02 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-01-03 23:19:02 +0000
commitd4a6d90e2cbd92e404757d330fa573aacf0d474b (patch)
tree602923df0a0d462ec476ade4510bbe04c07213a5
parentceb5b2f5d8a0f012f246f031a46f860d39a150fb (diff)
downloadpaludis-d4a6d90e2cbd92e404757d330fa573aacf0d474b.tar.gz
paludis-d4a6d90e2cbd92e404757d330fa573aacf0d474b.tar.xz
Tidy up some of the EAPI options.
-rw-r--r--paludis/dep_list_TEST.cc64
-rw-r--r--paludis/name-fwd.hh9
-rw-r--r--paludis/name.cc29
-rw-r--r--paludis/name.se12
-rw-r--r--paludis/name.sr2
-rw-r--r--paludis/repositories/e/dep_parser.cc3
-rw-r--r--paludis/repositories/e/dep_parser.se21
-rw-r--r--paludis/repositories/e/e_key.cc2
-rw-r--r--paludis/repositories/e/eapi.cc14
-rw-r--r--paludis/repositories/e/eapi.sr3
-rw-r--r--paludis/repositories/e/eapis/0.conf4
-rw-r--r--paludis/repositories/e/eapis/1.conf4
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf5
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf6
-rw-r--r--paludis/repositories/fake/fake_package_id.cc11
-rw-r--r--paludis/repositories/fake/fake_package_id.hh4
-rw-r--r--python/additional_tests.cc2
-rwxr-xr-xpython/metadata_key_TEST.py2
-rw-r--r--python/name.cc13
-rwxr-xr-xpython/name_TEST.py5
-rw-r--r--ruby/name.cc12
21 files changed, 107 insertions, 120 deletions
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index 945afa8..e2bc97f 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -922,7 +922,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("( cat/two[enabled] )");
- repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -942,7 +942,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("( cat/two[-disabled] )");
- repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -962,7 +962,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("( cat/two[disabled] )");
- repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -989,7 +989,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("( cat/two[-enabled] )");
- repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -1016,7 +1016,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("( cat/two cat/two[enabled] )");
- repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -1036,7 +1036,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("( cat/two cat/two[-disabled] )");
- repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -1056,7 +1056,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("( cat/two cat/two[disabled] )");
- repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -1083,7 +1083,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("( cat/two cat/two[-enabled] )");
- repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat", "two", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -1399,11 +1399,11 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "enabled", "1")->build_dependencies_key()->set_from_string("( cat2/enabled[pkgname?] )");
- repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat3", "disabled", "1")->build_dependencies_key()->set_from_string("( cat4/enabled[pkgname?] )");
- repo->add_version("cat4", "enabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat4", "enabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat5", "disabled", "1")->build_dependencies_key()->set_from_string("( cat6/disabled[pkgname?] )");
- repo->add_version("cat6", "disabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat6", "disabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat", "all", "1")->build_dependencies_key()->set_from_string("( cat5/disabled cat3/disabled cat1/enabled )");
}
@@ -1429,7 +1429,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "enabled", "1")->build_dependencies_key()->set_from_string("( cat2/disabled[pkgname?] )");
- repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -1456,11 +1456,11 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "disabled", "1")->build_dependencies_key()->set_from_string("( cat2/enabled[pkgname!?] )");
- repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat3", "enabled", "1")->build_dependencies_key()->set_from_string("( cat4/enabled[pkgname!?] )");
- repo->add_version("cat4", "enabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat4", "enabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat5", "enabled", "1")->build_dependencies_key()->set_from_string("( cat6/disabled[pkgname!?] )");
- repo->add_version("cat6", "disabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat6", "disabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat", "all", "1")->build_dependencies_key()->set_from_string("( cat5/enabled cat3/enabled cat1/disabled )");
}
@@ -1486,7 +1486,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "disabled", "1")->build_dependencies_key()->set_from_string("( cat2/disabled[pkgname!?] )");
- repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -1513,11 +1513,11 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "enabled", "1")->build_dependencies_key()->set_from_string("( cat2/disabled[-pkgname?] )");
- repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat3", "disabled", "1")->build_dependencies_key()->set_from_string("( cat4/enabled[-pkgname?] )");
- repo->add_version("cat4", "enabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat4", "enabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat5", "disabled", "1")->build_dependencies_key()->set_from_string("( cat6/disabled[-pkgname?] )");
- repo->add_version("cat6", "disabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat6", "disabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat", "all", "1")->build_dependencies_key()->set_from_string("( cat5/disabled cat3/disabled cat1/enabled )");
}
@@ -1543,7 +1543,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "enabled", "1")->build_dependencies_key()->set_from_string("( cat2/enabled[-pkgname?] )");
- repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -1570,11 +1570,11 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "disabled", "1")->build_dependencies_key()->set_from_string("( cat2/disabled[-pkgname!?] )");
- repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat3", "enabled", "1")->build_dependencies_key()->set_from_string("( cat4/enabled[-pkgname!?] )");
- repo->add_version("cat4", "enabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat4", "enabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat5", "enabled", "1")->build_dependencies_key()->set_from_string("( cat6/disabled[-pkgname!?] )");
- repo->add_version("cat6", "disabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat6", "disabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat", "all", "1")->build_dependencies_key()->set_from_string("( cat5/enabled cat3/enabled cat1/disabled )");
}
@@ -1600,7 +1600,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "disabled", "1")->build_dependencies_key()->set_from_string("( cat2/disabled[-pkgname!?] )");
- repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -1627,9 +1627,9 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "enabled", "1")->build_dependencies_key()->set_from_string("( cat2/enabled[pkgname=] )");
- repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat3", "disabled", "1")->build_dependencies_key()->set_from_string("( cat4/disabled[pkgname=] )");
- repo->add_version("cat4", "disabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat4", "disabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat", "all", "1")->build_dependencies_key()->set_from_string("( cat3/disabled cat1/enabled )");
}
@@ -1653,7 +1653,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "enabled", "1")->build_dependencies_key()->set_from_string("( cat2/disabled[pkgname=] )");
- repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -1680,7 +1680,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "disabled", "1")->build_dependencies_key()->set_from_string("( cat2/enabled[pkgname=] )");
- repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -1707,9 +1707,9 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "enabled", "1")->build_dependencies_key()->set_from_string("( cat2/disabled[pkgname!=] )");
- repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat3", "disabled", "1")->build_dependencies_key()->set_from_string("( cat4/enabled[pkgname!=] )");
- repo->add_version("cat4", "enabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat4", "enabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
repo->add_version("cat", "all", "1")->build_dependencies_key()->set_from_string("( cat3/disabled cat1/enabled )");
}
@@ -1733,7 +1733,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "enabled", "1")->build_dependencies_key()->set_from_string("( cat2/disabled[pkgname!=] )");
- repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "enabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
@@ -1760,7 +1760,7 @@ namespace test_cases
void populate_repo()
{
repo->add_version("cat1", "disabled", "1")->build_dependencies_key()->set_from_string("( cat2/enabled[pkgname!=] )");
- repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", iuse_pm_permissive);
+ repo->add_version("cat2", "disabled", "1")->iuse_key()->set_from_string("ebuild", IUseFlagParseOptions());
}
void populate_expected()
diff --git a/paludis/name-fwd.hh b/paludis/name-fwd.hh
index 787864d..448067d 100644
--- a/paludis/name-fwd.hh
+++ b/paludis/name-fwd.hh
@@ -24,6 +24,7 @@
#include <paludis/util/set-fwd.hh>
#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/attributes.hh>
+#include <paludis/util/options-fwd.hh>
#include <string>
/** \file
@@ -94,6 +95,14 @@ namespace paludis
class IUseFlag;
/**
+ * Options for IUseFlag.
+ *
+ * \ingroup g_names
+ * \since 0.26
+ */
+ typedef Options<IUseFlagParseOption> IUseFlagParseOptions;
+
+ /**
* Output a QualifiedPackageName to a stream.
*
* \ingroup g_names
diff --git a/paludis/name.cc b/paludis/name.cc
index c56a208..7ae69b3 100644
--- a/paludis/name.cc
+++ b/paludis/name.cc
@@ -25,6 +25,7 @@
#include <paludis/util/set-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator-impl.hh>
+#include <paludis/util/options.hh>
#include <ostream>
#include <utility>
@@ -397,7 +398,7 @@ namespace
return UseFlagName(s.substr(1));
}
- UseFlagState get_state(const std::string & s, IUseFlagParseMode m)
+ UseFlagState get_state(const std::string & s, const IUseFlagParseOptions & o)
{
Context c("When extracting USE flag state from IUSE flag '" + s + "':");
@@ -405,34 +406,24 @@ namespace
return use_unspecified;
if ('-' == s[0] || '+' == s[0])
{
- switch (m)
+ if (! o[iufpo_allow_iuse_defaults])
{
- case iuse_pm_eapi_0:
+ if (o[iufpo_strict_parsing])
+ throw IUseFlagNameError(s, "+/- prefixed IUSE flag names not allowed in this EAPI");
+ else
Log::get_instance()->message(ll_warning, lc_context,
"+/- prefixed IUSE flag names not allowed in this EAPI");
-
- /* fall through */
-
- case iuse_pm_permissive:
- case iuse_pm_eapi_1:
- case iuse_pm_eapi_1_strict:
- return '-' == s[0] ? use_disabled : use_enabled;
-
- case iuse_pm_eapi_0_strict:
- case iuse_pm_exheres_0:
- throw IUseFlagNameError(s, "+/- prefixed IUSE flag names not allowed in this EAPI");
-
- case last_iuse_pm:
- ;
}
+
+ return '-' == s[0] ? use_disabled : use_enabled;
}
return use_unspecified;
}
}
-IUseFlag::IUseFlag(const std::string & s, IUseFlagParseMode m, const std::string::size_type p) try:
+IUseFlag::IUseFlag(const std::string & s, const IUseFlagParseOptions & o, const std::string::size_type p) try:
flag(get_flag(s)),
- state(get_state(s, m)),
+ state(get_state(s, o)),
prefix_delim_pos(p)
{
}
diff --git a/paludis/name.se b/paludis/name.se
index 664f805..c0c6019 100644
--- a/paludis/name.se
+++ b/paludis/name.se
@@ -18,17 +18,13 @@ make_enum_UseFlagState()
END
}
-make_enum_IUseFlagParseMode()
+make_enum_IUseFlagParseOption()
{
- prefix iuse_pm
+ prefix iufpo
want_destringify
- key iuse_pm_eapi_0 "EAPI 0"
- key iuse_pm_eapi_0_strict "EAPI 0, errors for non-permitted things"
- key iuse_pm_eapi_1 "EAPI 1"
- key iuse_pm_eapi_1_strict "EAPI 1, errors for non-permitted things"
- key iuse_pm_exheres_0 "EAPI exheres-0"
- key iuse_pm_permissive "Permissive"
+ key iufpo_allow_iuse_defaults "Allow +/- prefixes"
+ key iufpo_strict_parsing "Error rather than warn for violations"
doxygen_comment << "END"
/**
diff --git a/paludis/name.sr b/paludis/name.sr
index 617bac0..b1dea93 100644
--- a/paludis/name.sr
+++ b/paludis/name.sr
@@ -35,7 +35,7 @@ make_class_IUseFlag()
comparison_operators all flag
extra_constructors <<END
- IUseFlag(const std::string &, const IUseFlagParseMode, const std::string::size_type);
+ IUseFlag(const std::string &, const IUseFlagParseOptions &, const std::string::size_type);
END
doxygen_comment << "END"
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 0b19848..f2f7f30 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -709,7 +709,8 @@ paludis::erepository::parse_fetchable_uri(const std::string & s, const EAPI & e)
throw DepStringParseError(s, "Don't know how to parse EAPI '" + e.name + "' URIs");
return parse<FetchableURISpecTree, ParseFetchableURIDepSpec, false, true, LabelsAreURI>(s, false,
- ParseFetchableURIDepSpec(e.supported->uri_supports_arrow), e, tr1::shared_ptr<const PackageID>());
+ ParseFetchableURIDepSpec(e.supported->dependency_spec_tree_parse_options[dstpo_uri_supports_arrow]),
+ e, tr1::shared_ptr<const PackageID>());
}
tr1::shared_ptr<SimpleURISpecTree::ConstItem>
diff --git a/paludis/repositories/e/dep_parser.se b/paludis/repositories/e/dep_parser.se
index bc5a5f6..b315600 100644
--- a/paludis/repositories/e/dep_parser.se
+++ b/paludis/repositories/e/dep_parser.se
@@ -1,26 +1,6 @@
#!/bin/bash
# vim: set sw=4 sts=4 et ft=sh :
-make_enum_DependencySpecTreeParseMode()
-{
- prefix dst_pm
- want_destringify
- namespace paludis::erepository
-
- key dst_pm_eapi_0 "EAPI 0"
- key dst_pm_exheres_0 "EAPI exheres-0"
- key dst_pm_paludis_1 "EAPI paludis-1"
-
- doxygen_comment << "END"
- /**
- * How DepParser should parse a DependencySpecTree string.
- *
- * \see DepParser
- * \ingroup grpdepspecs
- */
-END
-}
-
make_enum_PackageDepSpecParseOption()
{
prefix pdspo
@@ -42,5 +22,6 @@ make_enum_DependencySpecTreeParseOption()
namespace paludis::erepository
key dstpo_disallow_any_use "Disallow || ( use? ( ... ) )"
+ key dstpo_uri_supports_arrow "Allow -> in FetchableURIDepSpec"
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index a0c086f..99337fc 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -586,7 +586,7 @@ EIUseKey::value() const
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
t != t_end ; ++t)
{
- IUseFlag f(*t, _imp->id->eapi()->supported->iuse_flag_parse_mode, std::string::npos);
+ IUseFlag f(*t, _imp->id->eapi()->supported->iuse_flag_parse_options, std::string::npos);
for (UseFlagNameSet::ConstIterator p(prefixes->begin()), p_end(prefixes->end()) ;
p != p_end ; ++p)
if (0 == stringify(f.flag).compare(0, stringify(*p).length(), stringify(*p), 0, stringify(*p).length()))
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 85eb2fc..1ae3eca 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -87,14 +87,22 @@ namespace paludis
dependency_spec_tree_parse_options += destringify<DependencySpecTreeParseOption>(*t);
}
+ IUseFlagParseOptions iuse_flag_parse_options;
+ {
+ std::list<std::string> iuse_flag_parse_options_tokens;
+ tokenise_whitespace(k.get("iuse_flag_parse_options"), std::back_inserter(iuse_flag_parse_options_tokens));
+ for (std::list<std::string>::const_iterator t(iuse_flag_parse_options_tokens.begin()),
+ t_end(iuse_flag_parse_options_tokens.end()) ;
+ t != t_end ; ++t)
+ iuse_flag_parse_options += destringify<IUseFlagParseOption>(*t);
+ }
+
tr1::shared_ptr<EAPI> eapi(new EAPI(strip_trailing_string(d->basename(), ".conf"), make_shared_ptr(new SupportedEAPI(
SupportedEAPI::create()
.package_dep_spec_parse_options(package_dep_spec_parse_options)
.dependency_spec_tree_parse_options(dependency_spec_tree_parse_options)
- .iuse_flag_parse_mode(destringify<IUseFlagParseMode>(
- k.get("iuse_flag_parse_mode")))
+ .iuse_flag_parse_options(iuse_flag_parse_options)
.breaks_portage(destringify<bool>(k.get("breaks_portage")))
- .uri_supports_arrow(destringify<bool>(k.get("uri_supports_arrow")))
.ebuild_options(make_shared_ptr(new EAPIEbuildOptions(
EAPIEbuildOptions::create()
diff --git a/paludis/repositories/e/eapi.sr b/paludis/repositories/e/eapi.sr
index 5f676c7..ea8916c 100644
--- a/paludis/repositories/e/eapi.sr
+++ b/paludis/repositories/e/eapi.sr
@@ -166,8 +166,7 @@ make_class_SupportedEAPI()
key package_dep_spec_parse_options "erepository::PackageDepSpecParseOptions"
key dependency_spec_tree_parse_options "erepository::DependencySpecTreeParseOptions"
- key iuse_flag_parse_mode IUseFlagParseMode
- key uri_supports_arrow bool
+ key iuse_flag_parse_options IUseFlagParseOptions
key breaks_portage bool
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index c5811c6..a3289b9 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -3,10 +3,8 @@
package_dep_spec_parse_options =
dependency_spec_tree_parse_options =
-iuse_flag_parse_mode = eapi_0
-strict_iuse_flag_parse_mode = eapi_0_strict
+iuse_flag_parse_options =
breaks_portage = false
-uri_supports_arrow = false
rdepend_defaults_to_depend = true
use_expand_separator = _
want_portage_emulation_vars = true
diff --git a/paludis/repositories/e/eapis/1.conf b/paludis/repositories/e/eapis/1.conf
index 4cef6c3..a491d28 100644
--- a/paludis/repositories/e/eapis/1.conf
+++ b/paludis/repositories/e/eapis/1.conf
@@ -3,10 +3,8 @@
package_dep_spec_parse_options = allow_slot_deps
dependency_spec_tree_parse_options =
-iuse_flag_parse_mode = eapi_1
-strict_iuse_flag_parse_mode = eapi_1_strict
+iuse_flag_parse_options = allow_iuse_defaults
breaks_portage = false
-uri_supports_arrow = false
rdepend_defaults_to_depend = true
use_expand_separator = _
want_portage_emulation_vars = true
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 541c6b6..d806f86 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -4,11 +4,10 @@
package_dep_spec_parse_options = allow_slot_deps allow_square_bracket_deps \
allow_tilde_greater_deps strict_star_operator strict_parsing
-dependency_spec_tree_parse_options = disallow_any_use
-iuse_flag_parse_mode = exheres_0
+dependency_spec_tree_parse_options = disallow_any_use uri_supports_arrow
+iuse_flag_parse_options = strict_parsing
breaks_portage = true
want_portage_emulation_vars = false
-uri_supports_arrow = true
require_use_expand_in_iuse = true
rdepend_defaults_to_depend = false
support_eclasses = false
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index 1975567..aa97a10 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -4,11 +4,9 @@
package_dep_spec_parse_options = allow_slot_deps allow_square_bracket_deps \
allow_repository_deps allow_tilde_greater_deps strict_parsing
-dependency_spec_tree_parse_options = disallow_any_use
-iuse_flag_parse_mode = permissive
+dependency_spec_tree_parse_options = disallow_any_use uri_supports_arrow
+iuse_flag_parse_options = allow_iuse_defaults
breaks_portage = true
-has_pkg_pretend = true
-uri_supports_arrow = true
rdepend_defaults_to_depend = false
want_portage_emulation_vars = false
require_use_expand_in_iuse = false
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 5ad7ae0..83d7ade 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -102,22 +102,22 @@ FakeMetadataKeywordSetKey::set_from_string(const std::string & s)
}
FakeMetadataIUseSetKey::FakeMetadataIUseSetKey(const std::string & r,
- const std::string & h, const std::string & v, const IUseFlagParseMode m, const MetadataKeyType t,
+ const std::string & h, const std::string & v, const IUseFlagParseOptions & o, const MetadataKeyType t,
const PackageID * const i, const Environment * const e) :
FakeMetadataCollectionKey<IUseFlagSet>(r, h, t, i, e)
{
- set_from_string(v, m);
+ set_from_string(v, o);
}
void
-FakeMetadataIUseSetKey::set_from_string(const std::string & s, const IUseFlagParseMode m)
+FakeMetadataIUseSetKey::set_from_string(const std::string & s, const IUseFlagParseOptions & o)
{
_imp->collection.reset(new IUseFlagSet);
std::list<std::string> tokens;
tokenise_whitespace(s, std::back_inserter(tokens));
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
t != t_end ; ++t)
- _imp->collection->insert(IUseFlag(*t, m, std::string::npos));
+ _imp->collection->insert(IUseFlag(*t, o, std::string::npos));
}
namespace paludis
@@ -401,7 +401,8 @@ namespace paludis
post_dependencies_labels(new DependencyLabelSequence),
suggested_dependencies_labels(new DependencyLabelSequence),
keywords(new FakeMetadataKeywordSetKey("KEYWORDS", "Keywords", "test", mkt_normal, id, env)),
- iuse(new FakeMetadataIUseSetKey("IUSE", "Used USE flags", "", iuse_pm_permissive, mkt_normal, id, env)),
+ iuse(new FakeMetadataIUseSetKey("IUSE", "Used USE flags", "",
+ erepository::EAPIData::get_instance()->eapi_from_string(eapi)->supported->iuse_flag_parse_options, mkt_normal, id, env)),
license(new FakeMetadataSpecTreeKey<LicenseSpecTree>("LICENSE", "Licenses",
"", tr1::bind(&erepository::parse_license, _1,
*erepository::EAPIData::get_instance()->eapi_from_string(eapi)), mkt_normal)),
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index 9925b4e..125674d 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -64,10 +64,10 @@ namespace paludis
public FakeMetadataCollectionKey<IUseFlagSet>
{
public:
- FakeMetadataIUseSetKey(const std::string &, const std::string &, const std::string &, const IUseFlagParseMode,
+ FakeMetadataIUseSetKey(const std::string &, const std::string &, const std::string &, const IUseFlagParseOptions &,
const MetadataKeyType, const PackageID * const, const Environment * const);
- void set_from_string(const std::string &, const IUseFlagParseMode);
+ void set_from_string(const std::string &, const IUseFlagParseOptions &);
virtual std::string pretty_print_flat(const Formatter<IUseFlag> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/python/additional_tests.cc b/python/additional_tests.cc
index c34cc26..b76289d 100644
--- a/python/additional_tests.cc
+++ b/python/additional_tests.cc
@@ -263,7 +263,7 @@ namespace formatter
// CanFormat for IUseRoles
void test_iuse_roles(CanFormat<IUseFlag> & f)
{
- IUseFlag u("iuse_flag", iuse_pm_permissive, 1);
+ IUseFlag u("iuse_flag", IUseFlagParseOptions(), 1);
f.format(u, Plain());
f.format(u, Enabled());
f.format(u, Disabled());
diff --git a/python/metadata_key_TEST.py b/python/metadata_key_TEST.py
index 4822c94..bf57184 100755
--- a/python/metadata_key_TEST.py
+++ b/python/metadata_key_TEST.py
@@ -155,7 +155,7 @@ class TestCase_02_MetadataKeys_suclassing(unittest.TestCase):
MetadataIUseFlagIterableKey.__init__(self, "raw", "human", MetadataKeyType.NORMAL)
def value(self):
- return [IUseFlag("iuse", IUseFlagParseMode.PERMISSIVE, -1)]
+ return [IUseFlag("iuse", IUseFlagParseOptions(), -1)]
def pretty_print_flat(self, f):
return f.format_iuse_flag_plain(IUseFlag("foo", UseFlagState.ENABLED, 0))
diff --git a/python/name.cc b/python/name.cc
index 6fa1e47..036a348 100644
--- a/python/name.cc
+++ b/python/name.cc
@@ -21,6 +21,7 @@
#include <python/exception.hh>
#include <python/validated.hh>
#include <python/iterable.hh>
+#include <python/options.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/name.hh>
@@ -68,10 +69,16 @@ void expose_name()
*/
enum_auto("UseFlagState", last_use,
"A USE flag can be on, off or unspecified.");
- enum_auto("IUseFlagParseMode", last_iuse_pm,
+ enum_auto("IUseFlagParseOption", last_iufpo,
"How to parse an IUSE flag string.");
/**
+ * Options
+ */
+ class_options<IUseFlagParseOptions>("IUseFlagParseOptions", "IUseFlagParseOption",
+ "Options for IUseFlag.");
+
+ /**
* PackageNamePart
*/
register_shared_ptrs_to_python<PackageNamePart>();
@@ -249,8 +256,8 @@ void expose_name()
(
"IUseFlag",
"Represents an IUse flag.",
- bp::init<const std::string &, IUseFlagParseMode, const std::string::size_type>(
- "__init__(string, IUseFlagParseMode, Integer)")
+ bp::init<const std::string &, IUseFlagParseOptions, const std::string::size_type>(
+ "__init__(string, IUseFlagParseOptions, Integer)")
)
.def(bp::init<const UseFlagName &, const UseFlagState &, const std::string::size_type>(
"__init__(UseFlagName, UseFlagState, Integer)"))
diff --git a/python/name_TEST.py b/python/name_TEST.py
index 9441983..e06b5b2 100755
--- a/python/name_TEST.py
+++ b/python/name_TEST.py
@@ -33,7 +33,7 @@ class TestCase_Names(unittest.TestCase):
self.names["repo"] = RepositoryName("repo")
self.names["keyword"] = KeywordName("keyword")
self.names["set"] = SetName("set")
- IUseFlag("foo", IUseFlagParseMode.PERMISSIVE, -1)
+ IUseFlag("foo", IUseFlagParseOptions(), -1)
IUseFlag("foo", UseFlagState.ENABLED, -1)
def test_2_create_error(self):
@@ -60,7 +60,8 @@ class TestCase_Names(unittest.TestCase):
def test_4_operators(self):
self.assert_(CategoryNamePart("cat-foo") + PackageNamePart("pkg") == QualifiedPackageName("cat-foo/pkg"))
- self.assert_(IUseFlag("foo", UseFlagState.ENABLED, -1) == IUseFlag("+foo", IUseFlagParseMode.PERMISSIVE, 2))
+ self.assert_(IUseFlag("foo", UseFlagState.ENABLED, -1) ==
+ IUseFlag("+foo", IUseFlagParseOptions() + IUseFlagParseOption.ALLOW_IUSE_DEFAULTS, 2))
def test_5_data_members(self):
diff --git a/ruby/name.cc b/ruby/name.cc
index 6bdee26..9e210a1 100644
--- a/ruby/name.cc
+++ b/ruby/name.cc
@@ -28,7 +28,7 @@ using namespace paludis::ruby;
namespace
{
- static VALUE c_iuse_flag_parse_mode;
+ static VALUE c_iuse_flag_parse_option;
void do_register_names()
{
@@ -37,12 +37,12 @@ namespace
*
* How to parse an IUSE flag string.
*/
- c_iuse_flag_parse_mode = rb_define_module_under(paludis_module(), "IUseFlagParseMode");
- for (IUseFlagParseMode l(static_cast<IUseFlagParseMode>(0)), l_end(last_iuse_pm) ; l != l_end ;
- l = static_cast<IUseFlagParseMode>(static_cast<int>(l) + 1))
- rb_define_const(c_iuse_flag_parse_mode, value_case_to_RubyCase(stringify(l)).c_str(), INT2FIX(l));
+ c_iuse_flag_parse_option = rb_define_module_under(paludis_module(), "IUseFlagParseOption");
+ for (IUseFlagParseOption l(static_cast<IUseFlagParseOption>(0)), l_end(last_iufpo) ; l != l_end ;
+ l = static_cast<IUseFlagParseOption>(static_cast<int>(l) + 1))
+ rb_define_const(c_iuse_flag_parse_option, value_case_to_RubyCase(stringify(l)).c_str(), INT2FIX(l));
- // cc_enum_special<paludis/name-se.hh, IUseFlagParseMode , c_iuse_flag_parse_mode>
+ // cc_enum_special<paludis/name-se.hh, IUseFlagParseOptions , c_iuse_flag_parse_options>
}
}