diff --git a/src/nimble.nim b/src/nimble.nim index 0300158..4d026d0 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -298,11 +298,11 @@ proc processDeps(pkginfo: PackageInfo, options: Options): seq[string] = for p in result: let pkgInfo = getPkgInfo(p, options) if pkgsInPath.hasKey(pkgInfo.name) and - pkgsInPath[pkgInfo.name] != pkgInfo.myVersion: + pkgsInPath[pkgInfo.name] != pkgInfo.version: raise newException(NimbleError, "Cannot satisfy the dependency on $1 $2 and $1 $3" % - [pkgInfo.name, pkgInfo.myVersion, pkgsInPath[pkgInfo.name]]) - pkgsInPath[pkgInfo.name] = pkgInfo.myVersion + [pkgInfo.name, pkgInfo.version, pkgsInPath[pkgInfo.name]]) + pkgsInPath[pkgInfo.name] = pkgInfo.version # We add the reverse deps to the JSON file here because we don't want # them added if the above errorenous condition occurs diff --git a/src/nimblepkg/packageinfo.nim b/src/nimblepkg/packageinfo.nim index cdbe4ff..573d504 100644 --- a/src/nimblepkg/packageinfo.nim +++ b/src/nimblepkg/packageinfo.nim @@ -211,8 +211,9 @@ proc findPkg*(pkglist: seq[tuple[pkginfo: PackageInfo, meta: MetaData]], for pkg in pkglist: if cmpIgnoreStyle(pkg.pkginfo.name, dep.name) != 0 and cmpIgnoreStyle(pkg.meta.url, dep.name) != 0: continue - if withinRange(newVersion(pkg.pkginfo.version), dep.ver): - if not result or newVersion(r.version) < newVersion(pkg.pkginfo.version): + if withinRange(newVersion(pkg.pkginfo.myVersion), dep.ver) or + withinRange(newVersion(pkg.pkginfo.version), dep.ver): + if not result or newVersion(r.version) < newVersion(pkg.pkginfo.myVersion): r = pkg.pkginfo result = true