| 420 | } |
| 421 | |
| 422 | ComponentContainer ComponentUpdateTask::collectTreeLinked(const QString& uid) |
| 423 | { |
| 424 | ComponentContainer linked; |
| 425 | |
| 426 | auto& components = d->m_profile->d->components; |
| 427 | auto& componentIndex = d->m_profile->d->componentIndex; |
| 428 | auto& instance = d->m_profile->d->m_instance; |
| 429 | for (auto comp : components) { |
| 430 | qCDebug(instanceProfileResolveC) << instance->name() << "|" |
| 431 | << "scanning" << comp->getID() << ":" << comp->getVersion() << "for tree link"; |
| 432 | auto dep = std::find_if(comp->m_cachedRequires.cbegin(), comp->m_cachedRequires.cend(), |
| 433 | [uid](const Meta::Require& req) -> bool { return req.uid == uid; }); |
| 434 | if (dep != comp->m_cachedRequires.cend()) { |
| 435 | qCDebug(instanceProfileResolveC) << instance->name() << "|" << comp->getID() << ":" << comp->getVersion() << "depends on" |
| 436 | << uid; |
| 437 | linked.append(comp); |
| 438 | } |
| 439 | } |
| 440 | auto iter = componentIndex.find(uid); |
| 441 | if (iter != componentIndex.end()) { |
| 442 | ComponentPtr comp = *iter; |
| 443 | comp->updateCachedData(); |
| 444 | qCDebug(instanceProfileResolveC) << instance->name() << "|" << comp->getID() << ":" << comp->getVersion() << "has" |
| 445 | << comp->m_cachedRequires.size() << "dependencies"; |
| 446 | for (auto dep : comp->m_cachedRequires) { |
| 447 | qCDebug(instanceProfileC) << instance->name() << "|" << uid << "depends on" << dep.uid; |
| 448 | auto found = componentIndex.find(dep.uid); |
| 449 | if (found != componentIndex.end()) { |
| 450 | qCDebug(instanceProfileC) << instance->name() << "|" << (*found)->getID() << "is present"; |
| 451 | linked.append(*found); |
| 452 | } |
| 453 | } |
| 454 | } |
| 455 | return linked; |
| 456 | } |
| 457 | |
| 458 | // FIXME, TODO: decouple dependency resolution from loading |
| 459 | // FIXME: This works directly with the PackProfile internals. It shouldn't! It needs richer data types than PackProfile uses. |
nothing calls this directly
no test coverage detected