parent
281a1d129a
commit
fe252c6ed6
6 changed files with 39 additions and 2 deletions
|
|
@ -205,7 +205,7 @@ proc processDeps(pkginfo: PackageInfo, options: Options): seq[PackageInfo] =
|
||||||
raise newException(NimbleError,
|
raise newException(NimbleError,
|
||||||
"Cannot satisfy the dependency on $1 $2 and $1 $3" %
|
"Cannot satisfy the dependency on $1 $2 and $1 $3" %
|
||||||
[pkgInfo.name, pkgInfo.version, pkgsInPath[pkgInfo.name]])
|
[pkgInfo.name, pkgInfo.version, pkgsInPath[pkgInfo.name]])
|
||||||
pkgsInPath[pkgInfo.name] = pkgInfo.version
|
pkgsInPath[pkgInfo.name] = pkgInfo.getConcreteVersion(options)
|
||||||
|
|
||||||
# We add the reverse deps to the JSON file here because we don't want
|
# We add the reverse deps to the JSON file here because we don't want
|
||||||
# them added if the above errorenous condition occurs
|
# them added if the above errorenous condition occurs
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ when not defined(nimscript):
|
||||||
preHooks*: HashSet[string]
|
preHooks*: HashSet[string]
|
||||||
name*: string
|
name*: string
|
||||||
## The version specified in the .nimble file.Assuming info is non-minimal,
|
## The version specified in the .nimble file.Assuming info is non-minimal,
|
||||||
## it will always be a non-special version such as '0.1.4'
|
## it will always be a non-special version such as '0.1.4'.
|
||||||
|
## If in doubt, use `getConcreteVersion` instead.
|
||||||
version*: string
|
version*: string
|
||||||
specialVersion*: string ## Either `myVersion` or a special version such as #head.
|
specialVersion*: string ## Either `myVersion` or a special version such as #head.
|
||||||
author*: string
|
author*: string
|
||||||
|
|
|
||||||
|
|
@ -487,6 +487,15 @@ proc toFullInfo*(pkg: PackageInfo, options: Options): PackageInfo =
|
||||||
else:
|
else:
|
||||||
return pkg
|
return pkg
|
||||||
|
|
||||||
|
proc getConcreteVersion*(pkgInfo: PackageInfo, options: Options): string =
|
||||||
|
## Returns a non-special version from the specified ``pkgInfo``. If the
|
||||||
|
## ``pkgInfo`` is minimal it looks it up and retrieves the concrete version.
|
||||||
|
result = pkgInfo.version
|
||||||
|
if pkgInfo.isMinimal:
|
||||||
|
let pkgInfo = pkgInfo.toFullInfo(options)
|
||||||
|
result = pkgInfo.version
|
||||||
|
assert(not newVersion(result).isSpecial)
|
||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
validatePackageName("foo_bar")
|
validatePackageName("foo_bar")
|
||||||
validatePackageName("f_oo_b_a_r")
|
validatePackageName("f_oo_b_a_r")
|
||||||
|
|
|
||||||
15
tests/issue432/issue432.nimble
Normal file
15
tests/issue432/issue432.nimble
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Package
|
||||||
|
|
||||||
|
version = "0.1.0"
|
||||||
|
author = "Dominik Picheta"
|
||||||
|
description = "A new awesome nimble package"
|
||||||
|
license = "MIT"
|
||||||
|
srcDir = "src"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
|
||||||
|
requires "nim >= 0.16.0"
|
||||||
|
requires "https://github.com/nimble-test/packagea#head",
|
||||||
|
"https://github.com/nimble-test/packagebin2"
|
||||||
7
tests/issue432/src/issue432.nim
Normal file
7
tests/issue432/src/issue432.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# This is just an example to get you started. A typical library package
|
||||||
|
# exports the main API in this file. Note that you cannot rename this file
|
||||||
|
# but you can remove it if you wish.
|
||||||
|
|
||||||
|
proc add*(x, y: int): int =
|
||||||
|
## Adds two files together.
|
||||||
|
return x + y
|
||||||
|
|
@ -79,6 +79,11 @@ proc hasLineStartingWith(lines: seq[string], prefix: string): bool =
|
||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
test "issue 432":
|
||||||
|
cd "issue432":
|
||||||
|
check execNimble("install", "-y", "--depsOnly").exitCode == QuitSuccess
|
||||||
|
check execNimble("install", "-y", "--depsOnly").exitCode == QuitSuccess
|
||||||
|
|
||||||
test "issue 708":
|
test "issue 708":
|
||||||
cd "issue708":
|
cd "issue708":
|
||||||
# TODO: We need a way to filter out compiler messages from the messages
|
# TODO: We need a way to filter out compiler messages from the messages
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue