aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/virtuals
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-29 00:59:37 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-01 03:57:52 +0000
commitd3dcce377a01c5b3ae0414e9e4dd67eaddc4ef0e (patch)
tree7d81deba8b41b103f927572df149c98941ed515c /paludis/repositories/virtuals
parenteba9fcb1d71dd48458d09c1328ba11ea06fbb40b (diff)
downloadpaludis-d3dcce377a01c5b3ae0414e9e4dd67eaddc4ef0e.tar.gz
paludis-d3dcce377a01c5b3ae0414e9e4dd67eaddc4ef0e.tar.xz
Tinker with labels
Diffstat (limited to 'paludis/repositories/virtuals')
-rw-r--r--paludis/repositories/virtuals/package_id.cc32
1 files changed, 22 insertions, 10 deletions
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index 7aee731ad..30f780acc 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -27,6 +27,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/name.hh>
#include <paludis/dep_spec.hh>
#include <paludis/version_spec.hh>
@@ -44,6 +45,7 @@
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/partially_made_package_dep_spec.hh>
+#include <paludis/always_enabled_dependency_label.hh>
using namespace paludis;
using namespace paludis::virtuals;
@@ -158,6 +160,24 @@ VirtualsDepKey::initial_labels() const
return _imp->labels;
}
+namespace
+{
+ struct VirtualsDepKeyData :
+ Singleton<VirtualsDepKeyData>
+ {
+ std::shared_ptr<DependenciesLabelSequence> bdep_labels;
+ std::shared_ptr<DependenciesLabelSequence> rdep_labels;
+
+ VirtualsDepKeyData() :
+ bdep_labels(std::make_shared<DependenciesLabelSequence>()),
+ rdep_labels(std::make_shared<DependenciesLabelSequence>())
+ {
+ bdep_labels->push_back(std::make_shared<AlwaysEnabledDependencyLabel<DependenciesBuildLabelTag> >("DEPEND"));
+ rdep_labels->push_back(std::make_shared<AlwaysEnabledDependencyLabel<DependenciesRunLabelTag> >("RDEPEND"));
+ }
+ };
+}
+
namespace paludis
{
template <>
@@ -167,8 +187,6 @@ namespace paludis
const RepositoryName repository_name;
const QualifiedPackageName name;
const VersionSpec version;
- std::shared_ptr<DependenciesLabelSequence> bdep_labels;
- std::shared_ptr<DependenciesLabelSequence> rdep_labels;
const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const PackageID> > > virtual_for;
const std::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > bdep;
const std::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > rdep;
@@ -185,17 +203,11 @@ namespace paludis
repository_name(r),
name(n),
version(p->version()),
- bdep_labels(std::make_shared<DependenciesLabelSequence>()),
- rdep_labels(std::make_shared<DependenciesLabelSequence>()),
virtual_for(std::make_shared<LiteralMetadataValueKey<std::shared_ptr<const PackageID> > >("VIRTUAL_FOR", "Virtual for", mkt_normal, p)),
- bdep(std::make_shared<virtuals::VirtualsDepKey>(e, "DEPEND", "Build dependencies", p, bdep_labels, b)),
- rdep(std::make_shared<virtuals::VirtualsDepKey>(e, "RDEPEND", "Run dependencies", p, rdep_labels, b)),
+ bdep(std::make_shared<virtuals::VirtualsDepKey>(e, "DEPEND", "Build dependencies", p, VirtualsDepKeyData::get_instance()->bdep_labels, b)),
+ rdep(std::make_shared<virtuals::VirtualsDepKey>(e, "RDEPEND", "Run dependencies", p, VirtualsDepKeyData::get_instance()->rdep_labels, b)),
has_masks(false)
{
- bdep_labels->push_back(std::make_shared<DependenciesBuildLabel>("DEPEND",
- return_literal_function(true)));
- rdep_labels->push_back(std::make_shared<DependenciesRunLabel>("RDEPEND",
- return_literal_function(true)));
}
};
}