aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-10 16:18:02 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-10 16:18:02 +0000
commit69b9f6756b9e7817e14eb9c3c0fe22322f8f462a (patch)
treee57b02eb48173431423cfe4585ba06d3a50812b6
parent61901e5d8ff7a2718e16b1ce674ee7aedcef207c (diff)
downloadpaludis-69b9f6756b9e7817e14eb9c3c0fe22322f8f462a.tar.gz
paludis-69b9f6756b9e7817e14eb9c3c0fe22322f8f462a.tar.xz
Track blocker kinds
-rw-r--r--paludis/dep_spec_annotations.hh2
-rw-r--r--paludis/dep_spec_annotations.se25
-rw-r--r--paludis/repositories/e/apply_annotations.cc1
-rw-r--r--paludis/resolver/package_or_block_dep_spec.cc3
4 files changed, 31 insertions, 0 deletions
diff --git a/paludis/dep_spec_annotations.hh b/paludis/dep_spec_annotations.hh
index 5fbd188..08245b0 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 17737c4..02c83ae 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 8e4614e..498c61d 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 17add1e..a4f992f 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
));