aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-02 10:53:57 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-02 10:53:57 +0100
commit8db0f7d2bb4f395180b3c06c5f22ad0934800aac (patch)
tree8ca996cf96a6fa5a9aa3dd45c370d594c8f90fef
parent6d3b0227c4c11718823439589fac0830fb07fce7 (diff)
downloadpaludis-8db0f7d2bb4f395180b3c06c5f22ad0934800aac.tar.gz
paludis-8db0f7d2bb4f395180b3c06c5f22ad0934800aac.tar.xz
runtime means runtime
But not yet "runtime, and only of runtime deps"...
-rw-r--r--paludis/resolver/labels_classifier-fwd.hh1
-rw-r--r--paludis/resolver/labels_classifier.cc13
-rw-r--r--src/clients/cave/resolve_common.cc10
3 files changed, 22 insertions, 2 deletions
diff --git a/paludis/resolver/labels_classifier-fwd.hh b/paludis/resolver/labels_classifier-fwd.hh
index 503a9ff..198ad5a 100644
--- a/paludis/resolver/labels_classifier-fwd.hh
+++ b/paludis/resolver/labels_classifier-fwd.hh
@@ -34,6 +34,7 @@ namespace paludis
bool is_just_build_dep(const SanitisedDependency & dep) PALUDIS_ATTRIBUTE((warn_unused_result));
bool is_just_fetch_dep(const SanitisedDependency & dep) PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool is_run_or_post_dep(const SanitisedDependency & dep) PALUDIS_ATTRIBUTE((warn_unused_result));
bool is_compiled_against_dep(const SanitisedDependency & dep) PALUDIS_ATTRIBUTE((warn_unused_result));
bool is_enabled_dep(const SanitisedDependency & dep) PALUDIS_ATTRIBUTE((warn_unused_result));
}
diff --git a/paludis/resolver/labels_classifier.cc b/paludis/resolver/labels_classifier.cc
index 155561c..0b67106 100644
--- a/paludis/resolver/labels_classifier.cc
+++ b/paludis/resolver/labels_classifier.cc
@@ -208,3 +208,16 @@ paludis::resolver::is_enabled_dep(const SanitisedDependency & dep)
return v.any_enabled;
}
+bool
+paludis::resolver::is_run_or_post_dep(const SanitisedDependency & dep)
+{
+ if (dep.active_dependency_labels()->empty())
+ throw InternalError(PALUDIS_HERE, "not implemented");
+
+ LabelsClassifier v;
+ std::for_each(indirect_iterator(dep.active_dependency_labels()->begin()),
+ indirect_iterator(dep.active_dependency_labels()->end()),
+ accept_visitor(v));
+ return v.includes_non_post_runish || v.includes_postish;
+}
+
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 969f828..fef34a8 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -133,7 +133,7 @@ namespace
return DestinationTypes() + dt_install_to_slash;
}
- DestinationTypes visit(const DependencyReason &) const
+ DestinationTypes visit(const DependencyReason & dep) const
{
DestinationTypes extras;
@@ -141,9 +141,15 @@ namespace
if (resolution_options.a_make.argument() == "binaries")
{
if (resolution_options.a_make_dependencies.argument() == "auto" ||
- resolution_options.a_make_dependencies.argument() == "runtime" ||
resolution_options.a_make_dependencies.argument() == "all")
extras += dt_create_binary;
+ else if (resolution_options.a_make_dependencies.argument() == "runtime")
+ {
+ /* this will track run deps of build deps, which isn't
+ * really right... */
+ if (is_run_or_post_dep(dep.sanitised_dependency()))
+ extras += dt_create_binary;
+ }
}
#endif