aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/dependencies_rewriter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/e/dependencies_rewriter.cc')
-rw-r--r--paludis/repositories/e/dependencies_rewriter.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/paludis/repositories/e/dependencies_rewriter.cc b/paludis/repositories/e/dependencies_rewriter.cc
index b0a785731..4264f940a 100644
--- a/paludis/repositories/e/dependencies_rewriter.cc
+++ b/paludis/repositories/e/dependencies_rewriter.cc
@@ -29,7 +29,9 @@
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/singleton-impl.hh>
#include <paludis/dep_spec_annotations.hh>
+#include <paludis/always_enabled_dependency_label.hh>
#include <list>
#include <algorithm>
@@ -54,6 +56,19 @@ namespace
}
return s.str();
}
+
+ struct DependenciesRewriterData :
+ Singleton<DependenciesRewriterData>
+ {
+ std::shared_ptr<DependenciesLabelSequence> default_labels;
+
+ DependenciesRewriterData() :
+ default_labels(std::make_shared<DependenciesLabelSequence>())
+ {
+ default_labels->push_back(std::make_shared<AlwaysEnabledDependencyLabel<DependenciesBuildLabelTag> >("build"));
+ default_labels->push_back(std::make_shared<AlwaysEnabledDependencyLabel<DependenciesRunLabelTag> >("run"));
+ }
+ };
}
namespace paludis
@@ -65,15 +80,11 @@ namespace paludis
std::string rdepend;
std::string pdepend;
- std::shared_ptr<DependenciesLabelSequence> default_labels;
LabelsStack labels;
- Imp() :
- default_labels(std::make_shared<DependenciesLabelSequence>())
+ Imp()
{
- default_labels->push_back(std::make_shared<DependenciesBuildLabel>("build", return_literal_function(true)));
- default_labels->push_back(std::make_shared<DependenciesRunLabel>("run", return_literal_function(true)));
- labels.push_front(default_labels);
+ labels.push_front(DependenciesRewriterData::get_instance()->default_labels);
}
};
}