aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2012-03-02 21:11:31 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2012-03-03 19:57:19 +0000
commit27e14ae3a2bf90e8e2fd285710442373fca5739c (patch)
tree40bc2f4ec46d93b03499ed03c90f1cad94f7f4c5
parentf3b562877c5345fb403261e2a1d3d68b83de7967 (diff)
downloadpaludis-27e14ae3a2bf90e8e2fd285710442373fca5739c.tar.gz
paludis-27e14ae3a2bf90e8e2fd285710442373fca5739c.tar.xz
Forward BlockDepSpec annotations to the contained PackageDepSpec
Doesn't really make much sense for them to have separate annotations, and merging them like this means that the blocker's annotations are visible to match_package, which is potentially useful.
-rw-r--r--paludis/dep_spec.cc12
-rw-r--r--paludis/dep_spec.hh20
2 files changed, 30 insertions, 2 deletions
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 10482c8..f6acb35 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -224,6 +224,18 @@ BlockDepSpec::BlockDepSpec(const BlockDepSpec & other) :
set_annotations(other.maybe_annotations());
}
+const std::shared_ptr<const DepSpecAnnotations>
+BlockDepSpec::maybe_annotations() const
+{
+ return _spec.maybe_annotations();
+}
+
+void
+BlockDepSpec::set_annotations(const std::shared_ptr<const DepSpecAnnotations> & anno)
+{
+ _spec.set_annotations(anno);
+}
+
std::ostream &
paludis::operator<< (std::ostream & s, const PlainTextDepSpec & a)
{
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index 68b5c70..07a3076 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -88,14 +88,14 @@ namespace paludis
*
* \since 0.58
*/
- const std::shared_ptr<const DepSpecAnnotations> maybe_annotations() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::shared_ptr<const DepSpecAnnotations> maybe_annotations() const PALUDIS_ATTRIBUTE((warn_unused_result));
/**
* Change our annotations, may be null.
*
* \since 0.58
*/
- void set_annotations(const std::shared_ptr<const DepSpecAnnotations> &);
+ virtual void set_annotations(const std::shared_ptr<const DepSpecAnnotations> &);
};
/**
@@ -601,6 +601,22 @@ namespace paludis
*/
const PackageDepSpec blocking() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ /**
+ * Our annotations, may be null. Forwards to the
+ * underlying PackageDepSpec.
+ *
+ * \since 0.73
+ */
+ virtual const std::shared_ptr<const DepSpecAnnotations> maybe_annotations() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ /**
+ * Change our annotations, may be null. Forwards to the
+ * underlying PackageDepSpec.
+ *
+ * \since 0.73
+ */
+ virtual void set_annotations(const std::shared_ptr<const DepSpecAnnotations> &);
+
virtual std::shared_ptr<DepSpec> clone() const PALUDIS_ATTRIBUTE((warn_unused_result));
};