aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-27 15:57:04 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-27 15:57:04 +0100
commite68ae481666d9c97d04e0ce1348d6461c2d83654 (patch)
tree6dd72737aa1d046468831c58e12f9d80607126b1
parent9e585429c66d0ffdcc7b5b746e8696b9f1524e53 (diff)
downloadpaludis-e68ae481666d9c97d04e0ce1348d6461c2d83654.tar.gz
paludis-e68ae481666d9c97d04e0ce1348d6461c2d83654.tar.xz
Fix fetch: deps from non-changing packages
-rw-r--r--paludis/resolver/orderer.cc56
-rw-r--r--paludis/resolver/orderer.hh3
2 files changed, 55 insertions, 4 deletions
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index eb136df..dc7e0aa 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -278,14 +278,17 @@ namespace
const std::tr1::shared_ptr<NAG> nag;
const ResolventsSet & ignore_dependencies_from_resolvents;
const Resolvent resolvent;
+ const std::tr1::function<NAGIndexRole (const Resolvent &)> role_for_fetching;
EdgesFromReasonVisitor(
const std::tr1::shared_ptr<NAG> & n,
const ResolventsSet & i,
- const Resolvent & v) :
+ const Resolvent & v,
+ const std::tr1::function<NAGIndexRole (const Resolvent &)> & f) :
nag(n),
ignore_dependencies_from_resolvents(i),
- resolvent(v)
+ resolvent(v),
+ role_for_fetching(f)
{
}
@@ -314,7 +317,7 @@ namespace
{
NAGIndex from(make_named_values<NAGIndex>(
n::resolvent() = r.from_resolvent(),
- n::role() = classifier.fetch ? nir_fetched : nir_done
+ n::role() = classifier.fetch ? role_for_fetching(r.from_resolvent()) : nir_done
));
NAGIndex to(make_named_values<NAGIndex>(
@@ -414,7 +417,8 @@ Orderer::resolve()
if (ignore_dependencies_from_resolvents.end() != ignore_edges_from_resolvents.find((*r)->resolvent()))
continue;
- EdgesFromReasonVisitor edges_from_reason_visitor(_imp->resolved->nag(), ignore_dependencies_from_resolvents, (*r)->resolvent());
+ EdgesFromReasonVisitor edges_from_reason_visitor(_imp->resolved->nag(), ignore_dependencies_from_resolvents, (*r)->resolvent(),
+ std::tr1::bind(&Orderer::_role_for_fetching, this, std::tr1::placeholders::_1));
for (Constraints::ConstIterator c((*r)->constraints()->begin()),
c_end((*r)->constraints()->end()) ;
c != c_end ; ++c)
@@ -791,3 +795,47 @@ Orderer::_schedule(
d->accept(ExtraScheduler(_imp->resolved, _imp->fetch_job_numbers, _imp->install_job_numbers, index));
}
+namespace
+{
+ struct RoleForFetchingVisitor
+ {
+ NAGIndexRole visit(const ChangesToMakeDecision &) const
+ {
+ return nir_fetched;
+ }
+
+ NAGIndexRole visit(const ExistingNoChangeDecision &) const
+ {
+ return nir_done;
+ }
+
+ NAGIndexRole visit(const UnableToMakeDecision &) const
+ {
+ return nir_done;
+ }
+
+ NAGIndexRole visit(const BreakDecision &) const
+ {
+ return nir_done;
+ }
+
+ NAGIndexRole visit(const RemoveDecision &) const
+ {
+ return nir_done;
+ }
+
+ NAGIndexRole visit(const NothingNoChangeDecision &) const
+ {
+ return nir_done;
+ }
+ };
+}
+
+NAGIndexRole
+Orderer::_role_for_fetching(
+ const Resolvent & resolvent) const
+{
+ return (*_imp->resolved->resolutions_by_resolvent()->find(
+ resolvent))->decision()->accept_returning<NAGIndexRole>(RoleForFetchingVisitor());
+}
+
diff --git a/paludis/resolver/orderer.hh b/paludis/resolver/orderer.hh
index e75280d..37dc01b 100644
--- a/paludis/resolver/orderer.hh
+++ b/paludis/resolver/orderer.hh
@@ -54,6 +54,9 @@ namespace paludis
const std::tr1::shared_ptr<const SortedStronglyConnectedComponents> & sub_ssccs,
const bool can_recurse);
+ NAGIndexRole _role_for_fetching(
+ const Resolvent & resolvent) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
public:
Orderer(
const Environment * const,