diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bisect.nim | 5 | ||||
-rw-r--r-- | lib/install.nim | 5 | ||||
-rw-r--r-- | lib/tools.nim | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/lib/bisect.nim b/lib/bisect.nim index ea4063c..3dad8b2 100644 --- a/lib/bisect.nim +++ b/lib/bisect.nim @@ -1,4 +1,5 @@ -import future, osproc, strutils +import + osproc, strutils {.passL: "-lalpm".} @@ -6,7 +7,7 @@ proc vercmp(a: cstring, b: cstring): cint {.cdecl, importc: "alpm_pkg_vercmp".} proc getSourceVersion(relativePath: string): seq[string] = - let lines = execProcess("/bin/bash", ["-c", + let lines = execProcess("/bin/bash", "", ["-c", """source "$1/PKGBUILD" && echo "$epoch" && echo "$pkgver" && echo "$pkgrel"""", "bash", relativePath], options = {}).split("\n") if lines.len == 4: diff --git a/lib/install.nim b/lib/install.nim index 03bebd5..5130acf 100644 --- a/lib/install.nim +++ b/lib/install.nim @@ -1,4 +1,5 @@ -import future, os, posix, sequtils, strutils +import + os, posix, sequtils, strutils, sugar proc splitCommands(params: seq[string], index: int, res: seq[seq[string]]): seq[seq[string]] = if index < params.len: @@ -53,7 +54,7 @@ proc handleInstall*(params: seq[string]): int = let packages = params[databaseIndex .. ^1] if packages.len /% 3 * 3 != packages.len: - raise newException(SystemError, "invalid arguments") + raise newException(CatchableError, "invalid arguments") let install: seq[tuple[name: string, file: string, mode: string]] = packages .distribute(packages.len /% 3) diff --git a/lib/tools.nim b/lib/tools.nim index 82cafff..e6c2b15 100644 --- a/lib/tools.nim +++ b/lib/tools.nim @@ -1,5 +1,6 @@ -import os, ospaths -import bisect, install +import + os, + bisect, install let fileName = paramStr(0).splitFile().name let appName = getAppFilename().splitFile().name |