Fixes isNil errors for compatibility with latest Nim.
This commit is contained in:
parent
e06ad6e497
commit
8134427266
6 changed files with 3 additions and 10 deletions
|
|
@ -622,7 +622,6 @@ proc listPaths(options: Options) =
|
||||||
## On success the proc returns normally.
|
## On success the proc returns normally.
|
||||||
cli.setSuppressMessages(true)
|
cli.setSuppressMessages(true)
|
||||||
assert options.action.typ == actionPath
|
assert options.action.typ == actionPath
|
||||||
assert(not options.action.packages.isNil)
|
|
||||||
|
|
||||||
if options.action.packages.len == 0:
|
if options.action.packages.len == 0:
|
||||||
raise newException(NimbleError, "A package name needs to be specified")
|
raise newException(NimbleError, "A package name needs to be specified")
|
||||||
|
|
|
||||||
|
|
@ -166,9 +166,6 @@ proc doDownload(url: string, downloadDir: string, verRange: VersionRange,
|
||||||
meth
|
meth
|
||||||
if $latest.ver != "":
|
if $latest.ver != "":
|
||||||
result = latest.ver
|
result = latest.ver
|
||||||
else:
|
|
||||||
# Result should already be set to #head here.
|
|
||||||
assert(not result.isNil)
|
|
||||||
|
|
||||||
removeDir(downloadDir)
|
removeDir(downloadDir)
|
||||||
if verRange.kind == verSpecial:
|
if verRange.kind == verSpecial:
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ proc getGlobal(g: ModuleGraph; ident: PSym): string =
|
||||||
else:
|
else:
|
||||||
let n = vm.globalCtx.getGlobalValue(ident)
|
let n = vm.globalCtx.getGlobalValue(ident)
|
||||||
if n.isStrLit:
|
if n.isStrLit:
|
||||||
result = if n.strVal.isNil: "" else: n.strVal
|
result = n.strVal
|
||||||
else:
|
else:
|
||||||
raiseVariableError(ident.name.s, "string")
|
raiseVariableError(ident.name.s, "string")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -371,8 +371,7 @@ proc findPkg*(pkglist: seq[tuple[pkgInfo: PackageInfo, meta: MetaData]],
|
||||||
if cmpIgnoreStyle(pkg.pkginfo.name, dep.name) != 0 and
|
if cmpIgnoreStyle(pkg.pkginfo.name, dep.name) != 0 and
|
||||||
cmpIgnoreStyle(pkg.meta.url, dep.name) != 0: continue
|
cmpIgnoreStyle(pkg.meta.url, dep.name) != 0: continue
|
||||||
if withinRange(pkg.pkgInfo, dep.ver):
|
if withinRange(pkg.pkgInfo, dep.ver):
|
||||||
let isNewer = (not r.version.isNil) and
|
let isNewer = newVersion(r.version) < newVersion(pkg.pkginfo.version)
|
||||||
newVersion(r.version) < newVersion(pkg.pkginfo.version)
|
|
||||||
if not result or isNewer:
|
if not result or isNewer:
|
||||||
r = pkg.pkginfo
|
r = pkg.pkginfo
|
||||||
result = true
|
result = true
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ proc saveNimbleMeta*(pkgDestDir, url, vcsRevision: string,
|
||||||
##
|
##
|
||||||
## isLink - Determines whether the installed package is a .nimble-link.
|
## isLink - Determines whether the installed package is a .nimble-link.
|
||||||
var nimblemeta = %{"url": %url}
|
var nimblemeta = %{"url": %url}
|
||||||
if not vcsRevision.isNil:
|
if vcsRevision.len > 0:
|
||||||
nimblemeta["vcsRevision"] = %vcsRevision
|
nimblemeta["vcsRevision"] = %vcsRevision
|
||||||
let files = newJArray()
|
let files = newJArray()
|
||||||
nimblemeta["files"] = files
|
nimblemeta["files"] = files
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,6 @@ proc `$`*(ver: Version): string {.borrow.}
|
||||||
|
|
||||||
proc hash*(ver: Version): Hash {.borrow.}
|
proc hash*(ver: Version): Hash {.borrow.}
|
||||||
|
|
||||||
proc isNil*(ver: Version): bool {.borrow.}
|
|
||||||
|
|
||||||
proc newVersion*(ver: string): Version =
|
proc newVersion*(ver: string): Version =
|
||||||
doAssert(ver.len == 0 or ver[0] in {'#', '\0'} + Digits,
|
doAssert(ver.len == 0 or ver[0] in {'#', '\0'} + Digits,
|
||||||
"Wrong version: " & ver)
|
"Wrong version: " & ver)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue