async Task ResolveDependencies(List<string> list, List<string> list2, List<Package> packages,
SpecificVersion depInfo, List<SpecificVersion> done, bool useFullName = false, bool noCheckout = false) {
if (!noCheckout && list.Contains(depInfo.Name.ToLower())) {
Repository.Log("Conflicting package, not resolving {0}", depInfo);
return;
}
var name = depInfo.GetFullName();
if (list2.Contains(name)) {
Repository.Log("Duplicate package, skipping {0}", name);
return;
}
list2.Add(name);
if (!done.Contains(depInfo)) {
await GetAndAddPackage(depInfo).ConfigureAwait(false);
done.Add(depInfo);
}
var package = Package.Factory.Open(Repo,
WorkDir.GetChildDirectoryWithName(useFullName ? name : depInfo.Name), name);
list.Add(depInfo.Name);
packages.Add(package);
// TODO: Higher level policy can be overwritten by dependencies (e.g specified dependency contraints). We dont want this.
foreach (var dep in package.MetaData.GetDependencies())
await
ResolveDependencies(list, list2, packages, ResolvePackageName(dep.GetFullName()), done, useFullName,
noCheckout).ConfigureAwait(false);
OrderPackageLast(list, packages, package);
}