@@ -779,7 +779,7 @@ class Dub {
779
779
}
780
780
}
781
781
enforce(pinfo.type != Json.Type.undefined, " No package " ~ packageId~ " was found matching the dependency " ~ range.toString());
782
- string ver = pinfo[" version" ].get ! string ;
782
+ Version ver = Version( pinfo[" version" ].get ! string ) ;
783
783
784
784
NativePath placement;
785
785
final switch (location) {
@@ -791,15 +791,15 @@ class Dub {
791
791
// always upgrade branch based versions - TODO: actually check if there is a new commit available
792
792
Package existing = m_packageManager.getPackage(packageId, ver, placement);
793
793
if (options & FetchOptions.printOnly) {
794
- if (existing && existing.version_ != Version( ver) )
794
+ if (existing && existing.version_ != ver)
795
795
logInfo(" A new version for %s is available (%s -> %s). Run \" %s\" to switch." ,
796
796
packageId.color(Mode.bold), existing.version_, ver,
797
797
text(" dub upgrade " , packageId).color(Mode.bold));
798
798
return null ;
799
799
}
800
800
801
801
if (existing) {
802
- if (! ver.startsWith( " ~ " ) || ! (options & FetchOptions.forceBranchUpgrade) || location == PlacementLocation.local) {
802
+ if (! ver.isBranch( ) || ! (options & FetchOptions.forceBranchUpgrade) || location == PlacementLocation.local) {
803
803
// TODO: support git working trees by performing a "git pull" instead of this
804
804
logDiagnostic(" Package %s %s (%s) is already present with the latest version, skipping upgrade." ,
805
805
packageId, ver, placement);
@@ -816,7 +816,7 @@ class Dub {
816
816
817
817
logDebug(" Acquiring package zip file" );
818
818
819
- NativePath dstpath = PackageManager.getPackagePath(placement, basePackageName, ver);
819
+ NativePath dstpath = PackageManager.getPackagePath(placement, basePackageName, ver.toString() );
820
820
if (! dstpath.existsFile())
821
821
mkdirRecurse(dstpath.toNativeString());
822
822
// For libraries leaking their import path
0 commit comments