Fix adding order dependent dependency resolution
PackageFSRoot::_AddPackage(): When adding a resolvable which isn't known yet, make sure all already added matching dependencies are resolved.
This commit is contained in:
parent
b143a5a861
commit
5165b6b1d8
@ -17,6 +17,9 @@ public:
|
||||
void AddDependency(Dependency* dependency);
|
||||
void RemoveDependency(Dependency* dependency);
|
||||
|
||||
void AddDependenciesToList(
|
||||
ResolvableDependencyList& list) const;
|
||||
|
||||
const char* Name() const;
|
||||
|
||||
bool IsLastDependency(Dependency* dependency) const;
|
||||
@ -45,6 +48,16 @@ DependencyFamily::RemoveDependency(Dependency* dependency)
|
||||
}
|
||||
|
||||
|
||||
inline void
|
||||
DependencyFamily::AddDependenciesToList(ResolvableDependencyList& list) const
|
||||
{
|
||||
for (FamilyDependencyList::ConstIterator it = fDependencies.GetIterator();
|
||||
Dependency* dependency = it.Next();) {
|
||||
list.Add(dependency);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline const char*
|
||||
DependencyFamily::Name() const
|
||||
{
|
||||
|
@ -246,6 +246,12 @@ PackageFSRoot::_AddPackage(Package* package)
|
||||
|
||||
family->AddResolvable(resolvable, dependenciesToUpdate);
|
||||
fResolvables.Insert(family);
|
||||
|
||||
// add pre-existing dependencies for that resolvable
|
||||
if (DependencyFamily* dependencyFamily
|
||||
= fDependencies.Lookup(resolvable->Name())) {
|
||||
dependencyFamily->AddDependenciesToList(dependenciesToUpdate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user