The dependency in terms of the DependencyGraph is the base package and not the sub package.
Only enqueue one update action for the same package.
1 parent 145856a commit 4be0d11bbcecc764487aae6d0eb85f022a99f1e7
@Matthias Dondorff Matthias Dondorff authored on 20 Aug 2013
Showing 3 changed files
View
6
source/dub/dependency.d
private void forAllDependencies(void delegate (const PkgType* avail, string pkgId, Dependency d, const Package issuer) dg) const {
foreach(string issuerPackag, issuer; m_packages) {
foreach(string depPkg, dependency; issuer.dependencies) {
auto availPkg = depPkg in m_packages;
auto availPkg = depPkg.getBasePackage() in m_packages;
dg(availPkg, depPkg, dependency, issuer);
}
}
}
 
Package r_master = new Package(R_json);
auto graph = new DependencyGraph(r_master);
 
// See #100, a dependency on a subpackage should only refer the base
// project.
auto missing = graph.missing();
//assert(missing.length == 0);
assert(missing.length == 0);
}
}
View
10
source/dub/package_.d
}
}
}
 
 
// @deprecated (move to private?)
string[] getSubPackagePath(string package_name)
{
return package_name.split(":");
}
 
// Returns the name of the base package in the case of some sub package or the
// package itself, if it is already a full package.
string getBasePackage(string package_name)
{
return package_name.getSubPackagePath()[0];
}
View
source/dub/project.d