aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-01 13:01:59 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-01 13:01:59 +0100
commit51072c71da09484183734add55c067bf3e7e4e63 (patch)
tree36faefa6b3d534dfd1d18eb174da31599f7245cb
parenta1f798a4945b1ae8fcf642698ec6009c3971b2e5 (diff)
downloadpaludis-51072c71da09484183734add55c067bf3e7e4e63.tar.gz
paludis-51072c71da09484183734add55c067bf3e7e4e63.tar.xz
Move labels logic into resolver/
-rw-r--r--paludis/resolver/Makefile.am2
-rw-r--r--paludis/resolver/labels_classifier-fwd.hh42
-rw-r--r--paludis/resolver/labels_classifier.cc210
-rw-r--r--paludis/resolver/labels_classifier.hh60
-rw-r--r--paludis/resolver/orderer.cc76
-rw-r--r--paludis/resolver/resolver_test.cc70
-rw-r--r--paludis/resolver/resolver_test.hh2
-rw-r--r--src/clients/cave/resolve_common.cc174
8 files changed, 325 insertions, 311 deletions
diff --git a/paludis/resolver/Makefile.am b/paludis/resolver/Makefile.am
index 561f8f8..ca7318f 100644
--- a/paludis/resolver/Makefile.am
+++ b/paludis/resolver/Makefile.am
@@ -42,6 +42,7 @@ noinst_HEADERS = \
job_lists.hh job_lists-fwd.hh \
job_requirements.hh job_requirements-fwd.hh \
job_state.hh job_state-fwd.hh \
+ labels_classifier.hh labels_classifier-fwd.hh \
nag.hh nag-fwd.hh \
orderer.hh orderer-fwd.hh \
orderer_notes.hh orderer_notes-fwd.hh \
@@ -77,6 +78,7 @@ libpaludisresolver_a_SOURCES = \
job_lists.cc \
job_requirements.cc \
job_state.cc \
+ labels_classifier.cc \
nag.cc \
orderer.cc \
orderer_notes.cc \
diff --git a/paludis/resolver/labels_classifier-fwd.hh b/paludis/resolver/labels_classifier-fwd.hh
new file mode 100644
index 0000000..503a9ff
--- /dev/null
+++ b/paludis/resolver/labels_classifier-fwd.hh
@@ -0,0 +1,42 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2010 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_LABELS_CLASSIFIER_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_LABELS_CLASSIFIER_FWD_HH 1
+
+#include <paludis/util/attributes.hh>
+#include <paludis/resolver/sanitised_dependencies-fwd.hh>
+
+namespace paludis
+{
+ namespace resolver
+ {
+ struct LabelsClassifier;
+
+ bool is_suggestion(const SanitisedDependency & dep) PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool is_recommendation(const SanitisedDependency & dep) PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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_compiled_against_dep(const SanitisedDependency & dep) PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool is_enabled_dep(const SanitisedDependency & dep) PALUDIS_ATTRIBUTE((warn_unused_result));
+ }
+}
+
+#endif
diff --git a/paludis/resolver/labels_classifier.cc b/paludis/resolver/labels_classifier.cc
new file mode 100644
index 0000000..155561c
--- /dev/null
+++ b/paludis/resolver/labels_classifier.cc
@@ -0,0 +1,210 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2010 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <paludis/resolver/labels_classifier.hh>
+#include <paludis/resolver/sanitised_dependencies.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/dep_label.hh>
+#include <algorithm>
+
+using namespace paludis;
+using namespace paludis::resolver;
+
+LabelsClassifier::LabelsClassifier() :
+ any_enabled(false),
+ includes_buildish(false),
+ includes_compile_against(false),
+ includes_fetch(false),
+ includes_non_post_runish(false),
+ includes_post(false),
+ includes_postish(false),
+ is_recommendation(false),
+ is_requirement(false),
+ is_suggestion(false)
+{
+}
+
+void
+LabelsClassifier::visit(const DependenciesBuildLabel & l)
+{
+ if (l.enabled())
+ {
+ is_requirement = true;
+ includes_buildish = true;
+ any_enabled = true;
+ }
+}
+
+void
+LabelsClassifier::visit(const DependenciesTestLabel & l)
+{
+ if (l.enabled())
+ {
+ is_requirement = true;
+ includes_buildish = true;
+ any_enabled = true;
+ }
+}
+
+void
+LabelsClassifier::visit(const DependenciesFetchLabel & l)
+{
+ if (l.enabled())
+ {
+ is_requirement = true;
+ includes_buildish = true;
+ includes_fetch = true;
+ any_enabled = true;
+ }
+}
+
+void
+LabelsClassifier::visit(const DependenciesRunLabel & l)
+{
+ if (l.enabled())
+ {
+ is_requirement = true;
+ includes_non_post_runish = true;
+ any_enabled = true;
+ }
+}
+
+void
+LabelsClassifier::visit(const DependenciesPostLabel & l)
+{
+ if (l.enabled())
+ {
+ is_requirement = true;
+ includes_postish = true;
+ any_enabled = true;
+ }
+}
+
+void
+LabelsClassifier::visit(const DependenciesInstallLabel & l)
+{
+ if (l.enabled())
+ {
+ is_requirement = true;
+ includes_buildish = true;
+ any_enabled = true;
+ }
+}
+
+void
+LabelsClassifier::visit(const DependenciesCompileAgainstLabel & l)
+{
+ if (l.enabled())
+ {
+ is_requirement = true;
+ includes_non_post_runish = true;
+ includes_buildish = true;
+ any_enabled = true;
+ }
+}
+
+void
+LabelsClassifier::visit(const DependenciesRecommendationLabel & l)
+{
+ if (l.enabled())
+ {
+ is_recommendation = true;
+ includes_postish = true;
+ any_enabled = true;
+ }
+}
+
+void
+LabelsClassifier::visit(const DependenciesSuggestionLabel & l)
+{
+ if (l.enabled())
+ {
+ is_suggestion = true;
+ includes_postish = true;
+ any_enabled = true;
+ }
+}
+
+bool
+paludis::resolver::is_suggestion(const SanitisedDependency & dep)
+{
+ if (dep.active_dependency_labels()->empty())
+ return false;
+
+ LabelsClassifier v;
+ std::for_each(indirect_iterator(dep.active_dependency_labels()->begin()),
+ indirect_iterator(dep.active_dependency_labels()->end()),
+ accept_visitor(v));
+ return v.is_suggestion && (! v.is_recommendation) && (! v.is_requirement);
+}
+
+bool
+paludis::resolver::is_recommendation(const SanitisedDependency & dep)
+{
+ if (dep.active_dependency_labels()->empty())
+ return false;
+
+ LabelsClassifier v;
+ std::for_each(indirect_iterator(dep.active_dependency_labels()->begin()),
+ indirect_iterator(dep.active_dependency_labels()->end()),
+ accept_visitor(v));
+ return v.is_recommendation && (! v.is_requirement);
+}
+
+bool
+paludis::resolver::is_just_build_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_buildish && ! v.includes_non_post_runish && ! v.includes_postish;
+}
+
+bool
+paludis::resolver::is_compiled_against_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_compile_against;
+}
+
+bool
+paludis::resolver::is_enabled_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.any_enabled;
+}
+
diff --git a/paludis/resolver/labels_classifier.hh b/paludis/resolver/labels_classifier.hh
new file mode 100644
index 0000000..6bea330
--- /dev/null
+++ b/paludis/resolver/labels_classifier.hh
@@ -0,0 +1,60 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2010 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_LABELS_CLASSIFIER_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_LABELS_CLASSIFIER_HH 1
+
+#include <paludis/resolver/labels_classifier-fwd.hh>
+#include <paludis/dep_label-fwd.hh>
+
+namespace paludis
+{
+ namespace resolver
+ {
+ struct LabelsClassifier
+ {
+ LabelsClassifier();
+
+ bool any_enabled;
+
+ bool includes_buildish;
+ bool includes_compile_against;
+ bool includes_fetch;
+ bool includes_non_post_runish;
+ bool includes_post;
+ bool includes_postish;
+
+ bool is_recommendation;
+ bool is_requirement;
+ bool is_suggestion;
+
+ void visit(const DependenciesBuildLabel &);
+ void visit(const DependenciesCompileAgainstLabel &);
+ void visit(const DependenciesFetchLabel &);
+ void visit(const DependenciesInstallLabel &);
+ void visit(const DependenciesPostLabel &);
+ void visit(const DependenciesRecommendationLabel &);
+ void visit(const DependenciesRunLabel &);
+ void visit(const DependenciesSuggestionLabel &);
+ void visit(const DependenciesTestLabel &);
+ };
+ }
+}
+
+#endif
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index f4822a8..1269648 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -34,6 +34,7 @@
#include <paludis/resolver/orderer_notes.hh>
#include <paludis/resolver/change_by_resolvent.hh>
#include <paludis/resolver/resolver_functions.hh>
+#include <paludis/resolver/labels_classifier.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
@@ -220,67 +221,6 @@ namespace
}
};
- struct LabelsClassifier
- {
- bool build;
- bool run;
- bool post;
- bool fetch;
-
- LabelsClassifier() :
- build(false),
- run(false),
- post(false),
- fetch(false)
- {
- }
-
- void visit(const DependenciesBuildLabel &)
- {
- build = true;
- }
-
- void visit(const DependenciesInstallLabel &)
- {
- build = true;
- }
-
- void visit(const DependenciesFetchLabel &)
- {
- fetch = true;
- }
-
- void visit(const DependenciesRunLabel &)
- {
- run = true;
- }
-
- void visit(const DependenciesTestLabel &)
- {
- build = true;
- }
-
- void visit(const DependenciesPostLabel &)
- {
- post = true;
- }
-
- void visit(const DependenciesSuggestionLabel &)
- {
- post = true;
- }
-
- void visit(const DependenciesRecommendationLabel &)
- {
- post = true;
- }
-
- void visit(const DependenciesCompileAgainstLabel &)
- {
- build = true;
- }
- };
-
struct EdgesFromReasonVisitor
{
const std::tr1::shared_ptr<NAG> nag;
@@ -314,7 +254,7 @@ namespace
l != l_end ; ++l)
(*l)->accept(classifier);
- if (classifier.build || classifier.run || classifier.fetch)
+ if (classifier.includes_buildish || classifier.includes_non_post_runish)
{
bool normal(true);
if (r.sanitised_dependency().spec().if_block())
@@ -323,7 +263,7 @@ namespace
NAGIndex from(make_named_values<NAGIndex>(
n::resolvent() = r.from_resolvent(),
- n::role() = classifier.fetch ? role_for_fetching(r.from_resolvent()) : nir_done
+ n::role() = classifier.includes_fetch ? role_for_fetching(r.from_resolvent()) : nir_done
));
NAGIndex to(make_named_values<NAGIndex>(
@@ -335,10 +275,10 @@ namespace
{
nag->add_edge(from, to,
make_named_values<NAGEdgeProperties>(
- n::build() = classifier.build || classifier.fetch,
- n::build_all_met() = r.already_met() || ! (classifier.build || classifier.fetch),
- n::run() = classifier.run,
- n::run_all_met() = r.already_met() || ! classifier.run
+ n::build() = classifier.includes_buildish,
+ n::build_all_met() = r.already_met() || ! classifier.includes_buildish,
+ n::run() = classifier.includes_non_post_runish,
+ n::run_all_met() = r.already_met() || ! classifier.includes_non_post_runish
));
}
else
@@ -352,7 +292,7 @@ namespace
));
}
}
- else if (classifier.post)
+ else if (classifier.includes_postish)
{
/* we won't add a backwards edge, since most post deps dep upon
* the thing requiring them anyway */
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index 6278334..77d72fc 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -29,6 +29,7 @@
#include <paludis/resolver/decider.hh>
#include <paludis/resolver/reason.hh>
#include <paludis/resolver/change_by_resolvent.hh>
+#include <paludis/resolver/labels_classifier.hh>
#include <paludis/util/map.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
@@ -122,63 +123,6 @@ paludis::resolver::resolver_test::get_destination_types_for_fn(const PackageDepS
namespace
{
- struct IsSuggestionVisitor
- {
- bool seen_not_suggestion;
- bool seen_suggestion;
-
- IsSuggestionVisitor() :
- seen_not_suggestion(false),
- seen_suggestion(false)
- {
- }
-
- void visit(const DependenciesBuildLabel &)
- {
- seen_not_suggestion = true;
- }
-
- void visit(const DependenciesTestLabel &)
- {
- seen_not_suggestion = true;
- }
-
- void visit(const DependenciesRunLabel &)
- {
- seen_not_suggestion = true;
- }
-
- void visit(const DependenciesPostLabel &)
- {
- seen_not_suggestion = true;
- }
-
- void visit(const DependenciesSuggestionLabel &)
- {
- seen_suggestion = true;
- }
-
- void visit(const DependenciesRecommendationLabel &)
- {
- seen_not_suggestion = true;
- }
-
- void visit(const DependenciesCompileAgainstLabel &)
- {
- seen_not_suggestion = true;
- }
-
- void visit(const DependenciesInstallLabel &)
- {
- seen_not_suggestion = true;
- }
-
- void visit(const DependenciesFetchLabel &)
- {
- seen_not_suggestion = true;
- }
- };
-
#ifdef ENABLE_VIRTUALS_REPOSITORY
std::string virtuals_repo_keys(const std::string & k)
{
@@ -202,21 +146,11 @@ namespace
#endif
}
-bool
-paludis::resolver::resolver_test::is_just_suggestion(const SanitisedDependency & dep)
-{
- IsSuggestionVisitor v;
- std::for_each(indirect_iterator(dep.active_dependency_labels()->begin()),
- indirect_iterator(dep.active_dependency_labels()->end()),
- accept_visitor(v));
- return v.seen_suggestion && ! v.seen_not_suggestion;
-}
-
SpecInterest
paludis::resolver::resolver_test::interest_in_spec_fn(
const std::tr1::shared_ptr<const Resolution> &, const SanitisedDependency & dep)
{
- if (is_just_suggestion(dep))
+ if (is_suggestion(dep))
return si_untaken;
else
return si_take;
diff --git a/paludis/resolver/resolver_test.hh b/paludis/resolver/resolver_test.hh
index fe50343..9d30961 100644
--- a/paludis/resolver/resolver_test.hh
+++ b/paludis/resolver/resolver_test.hh
@@ -82,8 +82,6 @@ namespace paludis
const std::tr1::shared_ptr<const SlotName> &,
const std::tr1::shared_ptr<const Reason> &);
- bool is_just_suggestion(const SanitisedDependency & dep);
-
UseExisting get_use_existing_fn(
const std::tr1::shared_ptr<const Resolution> &,
const PackageDepSpec &,
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 04558ec..41bc4c4 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -55,6 +55,7 @@
#include <paludis/resolver/job_lists.hh>
#include <paludis/resolver/decisions.hh>
#include <paludis/resolver/change_by_resolvent.hh>
+#include <paludis/resolver/labels_classifier.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/notifier_callback.hh>
#include <paludis/generator.hh>
@@ -89,179 +90,6 @@ namespace
typedef std::map<Resolvent, std::tr1::shared_ptr<Constraints> > InitialConstraints;
typedef std::list<PackageDepSpec> PackageDepSpecList;
- struct LabelTypesVisitor
- {
- bool is_suggestion;
- bool is_recommendation;
- bool is_requirement;
- bool seen_buildish_dep;
- bool seen_runish_dep;
- bool seen_compiled_against_dep;
- bool seen_enabled_dep;
-
- LabelTypesVisitor() :
- is_suggestion(false),
- is_recommendation(false),
- is_requirement(false),
- seen_buildish_dep(false),
- seen_runish_dep(false),
- seen_compiled_against_dep(false),
- seen_enabled_dep(false)
- {
- }
-
- void visit(const DependenciesBuildLabel & l)
- {
- if (l.enabled())
- {
- is_requirement = true;
- seen_buildish_dep = true;
- seen_enabled_dep = true;
- }
- }
-
- void visit(const DependenciesTestLabel & l)
- {
- if (l.enabled())
- {
- is_requirement = true;
- seen_buildish_dep = true;
- seen_enabled_dep = true;
- }
- }
-
- void visit(const DependenciesFetchLabel & l)
- {
- if (l.enabled())
- {
- is_requirement = true;
- seen_buildish_dep = true;
- seen_enabled_dep = true;
- }
- }
-
- void visit(const DependenciesRunLabel & l)
- {
- if (l.enabled())
- {
- is_requirement = true;
- seen_runish_dep = true;
- seen_enabled_dep = true;
- }
- }
-
- void visit(const DependenciesPostLabel & l)
- {
- if (l.enabled())
- {
- is_requirement = true;
- seen_runish_dep = true;
- seen_enabled_dep = true;
- }
- }
-
- void visit(const DependenciesInstallLabel & l)
- {
- if (l.enabled())
- {
- is_requirement = true;
- seen_buildish_dep = true;
- seen_enabled_dep = true;
- }
- }
-
- void visit(const DependenciesCompileAgainstLabel & l)
- {
- if (l.enabled())
- {
- is_requirement = true;
- seen_runish_dep = true;
- seen_buildish_dep = true;
- seen_enabled_dep = true;
- }
- }
-
- void visit(const DependenciesRecommendationLabel & l)
- {
- if (l.enabled())
- {
- is_recommendation = true;
- seen_runish_dep = true;
- seen_enabled_dep = true;
- }
- }
-
- void visit(const DependenciesSuggestionLabel & l)
- {
- if (l.enabled())
- {
- is_suggestion = true;
- seen_runish_dep = true;
- seen_enabled_dep = true;
- }
- }
- };
-
- bool is_suggestion(const SanitisedDependency & dep)
- {
- if (dep.active_dependency_labels()->empty())
- return false;
-
- LabelTypesVisitor v;
- std::for_each(indirect_iterator(dep.active_dependency_labels()->begin()),
- indirect_iterator(dep.active_dependency_labels()->end()),
- accept_visitor(v));
- return v.is_suggestion && (! v.is_recommendation) && (! v.is_requirement);
- }
-
- bool is_recommendation(const SanitisedDependency & dep)
- {
- if (dep.active_dependency_labels()->empty())
- return false;
-
- LabelTypesVisitor v;
- std::for_each(indirect_iterator(dep.active_dependency_labels()->begin()),
- indirect_iterator(dep.active_dependency_labels()->end()),
- accept_visitor(v));
- return v.is_recommendation && (! v.is_requirement);
- }
-
- bool is_just_build_dep(const SanitisedDependency & dep)
- {
- if (dep.active_dependency_labels()->empty())
- throw InternalError(PALUDIS_HERE, "not implemented");
-
- LabelTypesVisitor v;
- std::for_each(indirect_iterator(dep.active_dependency_labels()->begin()),
- indirect_iterator(dep.active_dependency_labels()->end()),
- accept_visitor(v));
- return v.seen_buildish_dep && ! v.seen_runish_dep;
- }
-
- bool is_compiled_against_dep(const SanitisedDependency & dep)
- {
- if (dep.active_dependency_labels()->empty())
- throw InternalError(PALUDIS_HERE, "not implemented");
-
- LabelTypesVisitor v;
- std::for_each(indirect_iterator(dep.active_dependency_labels()->begin()),
- indirect_iterator(dep.active_dependency_labels()->end()),
- accept_visitor(v));
- return v.seen_compiled_against_dep;
- }
-
- bool is_enabled_dep(const SanitisedDependency & dep)
- {
- if (dep.active_dependency_labels()->empty())
- throw InternalError(PALUDIS_HERE, "not implemented");
-
- LabelTypesVisitor v;
- std::for_each(indirect_iterator(dep.active_dependency_labels()->begin()),
- indirect_iterator(dep.active_dependency_labels()->end()),
- accept_visitor(v));
- return v.seen_enabled_dep;
- }
-
struct DestinationTypesFinder
{
const Environment * const env;