From f151d4bcca5606d26964cc91f46665e0e23ce798 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Fri, 26 Dec 2014 00:49:34 +0000 Subject: [PATCH] Allow 'nim' in dependency list & more s/nimrod/nim/ --- src/nimble.nim | 12 ++++++------ src/nimblepkg/config.nim | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/nimble.nim b/src/nimble.nim index 17100a1..aa41d8f 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -70,7 +70,7 @@ For more information read the Github readme: https://github.com/nim-lang/nimble#readme """ 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() = echo(help) @@ -381,7 +381,7 @@ proc processDeps(pkginfo: TPackageInfo, options: TOptions): seq[string] = let pkglist = getInstalledPkgs(options.getPkgsDir()) var reverseDeps: seq[tuple[name, version: string]] = @[] for dep in pkginfo.requires: - if dep.name == "nimrod": + if dep.name == "nimrod" or dep.name == "nim": let nimVer = getNimrodVersion() if not withinRange(nimVer, 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 ## to the packages this package depends on. ## 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) let realDir = pkgInfo.getRealDir() 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)): outFile.writeln("[Package]") outFile.writeln("name = \"" & pkgName & "\"") - outFile.writeln("version = \"0.01\"") + outFile.writeln("version = \"0.1.0\"") 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("") outFile.writeln("[Deps]") - outFile.writeln("Requires: \"nimrod >= 0.9.4\"") + outFile.writeln("Requires: \"nim >= 0.10.0\"") close(outFile) else: diff --git a/src/nimblepkg/config.nim b/src/nimblepkg/config.nim index bb9a172..d8d68f1 100644 --- a/src/nimblepkg/config.nim +++ b/src/nimblepkg/config.nim @@ -8,6 +8,7 @@ type TConfig* = object nimbleDir*: string chcp*: bool # Whether to change the code page in .cmd files on Win. + proc initConfig(): TConfig = if getNimrodVersion() > newVersion("0.9.6"):