diff options
Diffstat (limited to 'paludis')
-rw-r--r-- | paludis/dep_spec_annotations.hh | 2 | ||||
-rw-r--r-- | paludis/dep_spec_annotations.se | 25 | ||||
-rw-r--r-- | paludis/repositories/e/apply_annotations.cc | 1 | ||||
-rw-r--r-- | paludis/resolver/package_or_block_dep_spec.cc | 3 |
4 files changed, 31 insertions, 0 deletions
diff --git a/paludis/dep_spec_annotations.hh b/paludis/dep_spec_annotations.hh index 5fbd18804..08245b0ef 100644 --- a/paludis/dep_spec_annotations.hh +++ b/paludis/dep_spec_annotations.hh @@ -31,6 +31,7 @@ namespace paludis namespace n { typedef Name<struct name_key> key; + typedef Name<struct name_kind> kind; typedef Name<struct name_role> role; typedef Name<struct name_value> value; } @@ -38,6 +39,7 @@ namespace paludis struct DepSpecAnnotation { NamedValue<n::key, std::string> key; + NamedValue<n::kind, DepSpecAnnotationKind> kind; NamedValue<n::role, DepSpecAnnotationRole> role; NamedValue<n::value, std::string> value; }; diff --git a/paludis/dep_spec_annotations.se b/paludis/dep_spec_annotations.se index 17737c4f0..02c83aef3 100644 --- a/paludis/dep_spec_annotations.se +++ b/paludis/dep_spec_annotations.se @@ -37,3 +37,28 @@ make_enum_DepSpecAnnotationRole() END } +make_enum_DepSpecAnnotationKind() +{ + prefix dsak + + key dsak_literal "Specified literally" + key dsak_synthetic "Synthetic (e.g. for 0ish blockers)" + key dsak_expanded "Expanded from a *key" + key dsak_expandable "This is a *key" + + want_destringify + + doxygen_comment << "END" + /** + * What kind of annotation a DepSpecAnnotation is. + * + * Note that dsas_expandable annotations should generally be ignored + * for logic purposes, and that dsas_expanded should generally be + * ignored for display purposes. + * + * \ingroup g_dep_spec + * \since 0.59 + */ +END +} + diff --git a/paludis/repositories/e/apply_annotations.cc b/paludis/repositories/e/apply_annotations.cc index 8e4614e63..498c61daa 100644 --- a/paludis/repositories/e/apply_annotations.cc +++ b/paludis/repositories/e/apply_annotations.cc @@ -134,6 +134,7 @@ paludis::erepository::apply_annotations( annotations->add(make_named_values<DepSpecAnnotation>( n::key() = k->first, + n::kind() = dsak_literal, n::role() = role, n::value() = k->second)); } diff --git a/paludis/resolver/package_or_block_dep_spec.cc b/paludis/resolver/package_or_block_dep_spec.cc index 17add1e60..a4f992f75 100644 --- a/paludis/resolver/package_or_block_dep_spec.cc +++ b/paludis/resolver/package_or_block_dep_spec.cc @@ -89,6 +89,7 @@ PackageOrBlockDepSpec::serialise(Serialiser & s) const { w.member(SerialiserFlags<>(), "annotations_k_" + stringify(n), m->key()); w.member(SerialiserFlags<>(), "annotations_v_" + stringify(n), m->value()); + w.member(SerialiserFlags<>(), "annotations_n_" + stringify(n), stringify(m->kind())); w.member(SerialiserFlags<>(), "annotations_r_" + stringify(n), stringify(m->role())); ++n; } @@ -120,9 +121,11 @@ PackageOrBlockDepSpec::deserialise(Deserialisation & d, const std::shared_ptr<co { std::string key(v.member<std::string>("annotations_k_" + stringify(a))); std::string value(v.member<std::string>("annotations_v_" + stringify(a))); + std::string kind(v.member<std::string>("annotations_n_" + stringify(a))); std::string role(v.member<std::string>("annotations_r_" + stringify(a))); annotations->add(make_named_values<DepSpecAnnotation>( n::key() = key, + n::kind() = destringify<DepSpecAnnotationKind>(kind), n::role() = destringify<DepSpecAnnotationRole>(role), n::value() = value )); |