Allow 'nim' in dependency list & more s/nimrod/nim/

This commit is contained in:
Dominik Picheta 2014-12-26 00:49:34 +00:00
commit f151d4bcca
2 changed files with 7 additions and 6 deletions

View file

@ -70,7 +70,7 @@ For more information read the Github readme:
https://github.com/nim-lang/nimble#readme https://github.com/nim-lang/nimble#readme
""" """
nimbleVersion = "0.5.0" nimbleVersion = "0.5.0"
defaultPackageURL = "https://github.com/nimrod-code/packages/raw/master/packages.json" defaultPackageURL = "https://github.com/nim-lang/packages/raw/master/packages.json"
proc writeHelp() = proc writeHelp() =
echo(help) echo(help)
@ -381,7 +381,7 @@ proc processDeps(pkginfo: TPackageInfo, options: TOptions): seq[string] =
let pkglist = getInstalledPkgs(options.getPkgsDir()) let pkglist = getInstalledPkgs(options.getPkgsDir())
var reverseDeps: seq[tuple[name, version: string]] = @[] var reverseDeps: seq[tuple[name, version: string]] = @[]
for dep in pkginfo.requires: for dep in pkginfo.requires:
if dep.name == "nimrod": if dep.name == "nimrod" or dep.name == "nim":
let nimVer = getNimrodVersion() let nimVer = getNimrodVersion()
if not withinRange(nimVer, dep.ver): if not withinRange(nimVer, dep.ver):
quit("Unsatisfied dependency: " & dep.name & " (" & $dep.ver & ")") quit("Unsatisfied dependency: " & dep.name & " (" & $dep.ver & ")")
@ -467,7 +467,7 @@ proc installFromDir(dir: string, latest: bool, options: TOptions,
## Returns where package has been installed to, together with paths ## Returns where package has been installed to, together with paths
## to the packages this package depends on. ## to the packages this package depends on.
## The return value of this function is used by ## The return value of this function is used by
## ``processDeps`` to gather a list of paths to pass to the nimrod compiler. ## ``processDeps`` to gather a list of paths to pass to the nim compiler.
var pkgInfo = getPkgInfo(dir) var pkgInfo = getPkgInfo(dir)
let realDir = pkgInfo.getRealDir() let realDir = pkgInfo.getRealDir()
let binDir = options.getBinDir() let binDir = options.getBinDir()
@ -728,13 +728,13 @@ proc init(options: TOptions) =
if (not existsFile(os.getCurrentDir() / fName) and open(f=outFile, filename = fName, mode = fmWrite)): if (not existsFile(os.getCurrentDir() / fName) and open(f=outFile, filename = fName, mode = fmWrite)):
outFile.writeln("[Package]") outFile.writeln("[Package]")
outFile.writeln("name = \"" & pkgName & "\"") outFile.writeln("name = \"" & pkgName & "\"")
outFile.writeln("version = \"0.01\"") outFile.writeln("version = \"0.1.0\"")
outFile.writeln("author = \"Anonymous\"") outFile.writeln("author = \"Anonymous\"")
outFile.writeln("description = \"New Nimble project for Nimrod\"") outFile.writeln("description = \"New Nimble project for Nim\"")
outFile.writeln("license = \"BSD\"") outFile.writeln("license = \"BSD\"")
outFile.writeln("") outFile.writeln("")
outFile.writeln("[Deps]") outFile.writeln("[Deps]")
outFile.writeln("Requires: \"nimrod >= 0.9.4\"") outFile.writeln("Requires: \"nim >= 0.10.0\"")
close(outFile) close(outFile)
else: else:

View file

@ -8,6 +8,7 @@ type
TConfig* = object TConfig* = object
nimbleDir*: string nimbleDir*: string
chcp*: bool # Whether to change the code page in .cmd files on Win. chcp*: bool # Whether to change the code page in .cmd files on Win.
proc initConfig(): TConfig = proc initConfig(): TConfig =
if getNimrodVersion() > newVersion("0.9.6"): if getNimrodVersion() > newVersion("0.9.6"):