This commit is contained in:
Dominik Picheta 2017-01-03 19:25:36 +00:00
commit dda0c39e34
2 changed files with 12 additions and 6 deletions

View file

@ -290,12 +290,14 @@ proc readPackageInfo(nf: NimbleFile, options: Options,
# By default specialVersion is the same as version.
result.specialVersion = result.version
# The package directory name may include a "special" version
# (example #head). If so, it is given higher priority and therefore
# overwrites the .nimble file's version.
let version = parseVersionRange(minimalInfo.version)
if version.kind == verSpecial:
result.specialVersion = minimalInfo.version
# Only attempt to read a special version if `nf` is inside the $nimbleDir.
if nf.startsWith(options.getNimbleDir()):
# The package directory name may include a "special" version
# (example #head). If so, it is given higher priority and therefore
# overwrites the .nimble file's version.
let version = parseVersionRange(minimalInfo.version)
if version.kind == verSpecial:
result.specialVersion = minimalInfo.version
if not result.isMinimal:
options.pkgInfoCache[nf] = result

View file

@ -42,6 +42,10 @@ proc inLines(lines: seq[string], line: string): bool =
for i in lines:
if line.normalize in i.normalize: return true
test "can distinguish package reading in nimbleDir vs. other dirs (#304)":
cd "issue304" / "package-test":
check execNimble("tasks").exitCode == QuitSuccess
test "can build with #head and versioned package (#289)":
cd "issue289":
check execNimble(["install", "-y"]).exitCode == QuitSuccess