Change behaviour of multiple dependencies (all failed = unreachable)

This commit is contained in:
Henrik Triem 2020-01-22 16:57:31 +01:00 committed by Michael Friedrich
parent 2f82047737
commit d0c0beb8be
1 changed files with 13 additions and 3 deletions

View File

@ -72,15 +72,25 @@ bool Checkable::IsReachable(DependencyType dt, Dependency::Ptr *failedDependency
}
}
for (const Dependency::Ptr& dep : GetDependencies()) {
auto deps = GetDependencies();
int countFailed = 0;
for (const Dependency::Ptr& dep : deps) {
if (!dep->IsAvailable(dt)) {
countFailed++;
if (failedDependency)
*failedDependency = dep;
return false;
}
}
if (countFailed == deps.size()) {
Log(LogDebug, "Checkable")
<< "All dependencies have failed for checkable '" << GetName() << "': Marking as unreachable.";
return false;
}
if (failedDependency)
*failedDependency = nullptr;