diff --git a/source/dub/dub.d b/source/dub/dub.d index 97accde..fda08db 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -1174,13 +1174,15 @@ if (!path.absolute) path = m_rootPath ~ path; path.normalize(); - string[string] depVers; + VersionRange[string] depVers; string[] notFound; // keep track of any failed packages in here foreach (dep; deps) { - Version ver; try { - ver = getLatestVersion(dep); - depVers[dep] = ver.isBranch ? ver.toString() : "~>" ~ ver.toString(); + Version ver = getLatestVersion(dep); + if (ver.isBranch()) + depVers[dep] = VersionRange(ver); + else + depVers[dep] = VersionRange.fromString("~>" ~ ver.toString()); } catch (Exception e) { notFound ~= dep; } diff --git a/source/dub/init.d b/source/dub/init.d index 6c55cea..0ef26a2 100644 --- a/source/dub/init.d +++ b/source/dub/init.d @@ -38,7 +38,7 @@ package recipe and the file format used to store it prior to writing it to disk. */ -void initPackage(NativePath root_path, string[string] deps, string type, +void initPackage(NativePath root_path, VersionRange[string] deps, string type, PackageFormat format, scope RecipeCallback recipe_callback = null) { import std.conv : to;