aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-08-07 09:51:57 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-08-07 14:51:14 +0100
commitc949a7ca5fce8c386f0c5f34750c24e1f1c284b4 (patch)
tree8ed316742455a0e05f53c34a09cb3d4752b4f5e3
parent469c2493fc7d9e9679b8a0af61509ed31593bb9d (diff)
downloadpaludis-c949a7ca5fce8c386f0c5f34750c24e1f1c284b4.tar.gz
paludis-c949a7ca5fce8c386f0c5f34750c24e1f1c284b4.tar.xz
Allow presumed MYOPTIONS
-rw-r--r--paludis/dep_spec_annotations.cc1
-rw-r--r--paludis/dep_spec_annotations.se1
-rw-r--r--paludis/repositories/e/e_choices_key.cc14
-rw-r--r--paludis/repositories/e/eapi.cc1
-rw-r--r--paludis/repositories/e/eapi.hh2
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf1
-rw-r--r--paludis/repositories/e/parse_annotations.cc7
7 files changed, 27 insertions, 0 deletions
diff --git a/paludis/dep_spec_annotations.cc b/paludis/dep_spec_annotations.cc
index 29ba67c..26eb23b 100644
--- a/paludis/dep_spec_annotations.cc
+++ b/paludis/dep_spec_annotations.cc
@@ -134,6 +134,7 @@ paludis::find_blocker_role_in_annotations(
case dsar_myoptions_n_at_least_one:
case dsar_myoptions_n_at_most_one:
case dsar_myoptions_n_exactly_one:
+ case dsar_myoptions_presumed:
case dsar_suggestions_group_name:
case dsar_system_implicit:
case dsar_licence_last_checked:
diff --git a/paludis/dep_spec_annotations.se b/paludis/dep_spec_annotations.se
index 5e03b0e..c8c244f 100644
--- a/paludis/dep_spec_annotations.se
+++ b/paludis/dep_spec_annotations.se
@@ -30,6 +30,7 @@ make_enum_DepSpecAnnotationRole()
key dsar_myoptions_n_at_least_one "MYOPTIONS, at least one"
key dsar_myoptions_n_at_most_one "MYOPTIONS, at most one"
key dsar_myoptions_n_exactly_one "MYOPTIONS, exactly one"
+ key dsar_myoptions_presumed "MYOPTIONS, presumed"
key dsar_suggestions_group_name "Group name for suggestions"
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index bc12359..62ec649 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -40,6 +40,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/upper_lower.hh>
+#include <paludis/util/destringify.hh>
#include <paludis/environment.hh>
#include <paludis/choice.hh>
@@ -163,6 +164,19 @@ namespace
p->second.insert(std::make_pair(n, MyOptionsInfo{ m_role->value(), false })).first->second.description = m_role->value();
else
p->second.insert(std::make_pair(n, MyOptionsInfo{ m_role->value(), false }));
+
+ auto n_role(node.spec()->maybe_annotations()->find(dsar_myoptions_presumed));
+ if (n_role != node.spec()->maybe_annotations()->end())
+ {
+ try
+ {
+ p->second.insert(std::make_pair(n, MyOptionsInfo{ "", true })).first->second.presumed = destringify<bool>(n_role->value());
+ }
+ catch (const DestringifyError & e)
+ {
+ Log::get_instance()->message("e.myoptions_key.bad_presumed", ll_warning, lc_context) << "Bad presumed value '" << n_role->value() << "'";
+ }
+ }
}
else
p->second.insert(std::make_pair(n, MyOptionsInfo{ "", false }));
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 85effe5..81e6702 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -267,6 +267,7 @@ namespace
n::myoptions_number_selected_at_least_one() = k.get("annotations_myoptions_number_selected_at_least_one"),
n::myoptions_number_selected_at_most_one() = k.get("annotations_myoptions_number_selected_at_most_one"),
n::myoptions_number_selected_exactly_one() = k.get("annotations_myoptions_number_selected_exactly_one"),
+ n::myoptions_presumed() = k.get("annotations_myoptions_presumed"),
n::myoptions_requires() = k.get("annotations_myoptions_requires"),
n::suggestions_group_name() = k.get("annotations_suggesions_group_name"),
n::system_implicit() = k.get("annotations_system_implicit")
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 996e75b..61a3c8c 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -162,6 +162,7 @@ namespace paludis
typedef Name<struct name_myoptions_number_selected_at_least_one> myoptions_number_selected_at_least_one;
typedef Name<struct name_myoptions_number_selected_at_most_one> myoptions_number_selected_at_most_one;
typedef Name<struct name_myoptions_number_selected_exactly_one> myoptions_number_selected_exactly_one;
+ typedef Name<struct name_myoptions_presumed> myoptions_presumed;
typedef Name<struct name_myoptions_requires> myoptions_requires;
typedef Name<struct name_must_not_change_after_source_variables> must_not_change_after_source_variables;
typedef Name<struct name_must_not_change_variables> must_not_change_variables;
@@ -499,6 +500,7 @@ namespace paludis
NamedValue<n::myoptions_number_selected_at_least_one, std::string> myoptions_number_selected_at_least_one;
NamedValue<n::myoptions_number_selected_at_most_one, std::string> myoptions_number_selected_at_most_one;
NamedValue<n::myoptions_number_selected_exactly_one, std::string> myoptions_number_selected_exactly_one;
+ NamedValue<n::myoptions_presumed, std::string> myoptions_presumed;
NamedValue<n::myoptions_requires, std::string> myoptions_requires;
NamedValue<n::suggestions_group_name, std::string> suggestions_group_name;
NamedValue<n::system_implicit, std::string> system_implicit;
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 45ed0b3..3d74fd7 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -366,6 +366,7 @@ annotations_general_author = author
annotations_general_date = date
annotations_general_token = token
annotations_licence_last_checked = last-checked
+annotations_myoptions_presumed = presumed
annotations_myoptions_requires = requires
annotations_myoptions_number_selected = number-selected
annotations_myoptions_number_selected_at_least_one = at-least-one
diff --git a/paludis/repositories/e/parse_annotations.cc b/paludis/repositories/e/parse_annotations.cc
index 2b5ed65..8d7dd1a 100644
--- a/paludis/repositories/e/parse_annotations.cc
+++ b/paludis/repositories/e/parse_annotations.cc
@@ -100,6 +100,13 @@ paludis::erepository::parse_annotations(
role = dsar_myoptions_requires;
}
+ /* myoptions requires */
+ if (dsar_none == role)
+ {
+ if (key == eapi.supported()->annotations()->myoptions_presumed())
+ role = dsar_myoptions_presumed;
+ }
+
/* suggestions */
if (dsar_none == role)
{