aboutsummaryrefslogtreecommitdiff
path: root/src/aur.nim
diff options
context:
space:
mode:
authorkitsunyan2018-10-22 13:07:40 +0000
committerkitsunyan2018-10-22 13:07:40 +0000
commitd125243edc87a4bc961c7976f73fb2248050effb (patch)
treedf6d3adea6ddd1be054bb9e39e86c43bc09e402b /src/aur.nim
parent55507df52ba95c2d97f02f2c4d0cdd2355cadaa2 (diff)
Replace package info object tree with tuples
Diffstat (limited to 'src/aur.nim')
-rw-r--r--src/aur.nim10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/aur.nim b/src/aur.nim
index 7d38fad..f4d6c91 100644
--- a/src/aur.nim
+++ b/src/aur.nim
@@ -34,10 +34,8 @@ proc parseRpcPackageInfo(obj: JsonNode, repo: string): Option[RpcPackageInfo] =
let popularity = obj["Popularity"].getFloat(0)
if base.len > 0 and name.len > 0:
- some(RpcPackageInfo(repo: repo, base: base, name: name, version: version,
- description: description, maintainer: maintainer,
- firstSubmitted: firstSubmitted, lastModified: lastModified, outOfDate: outOfDate,
- votes: votes, popularity: popularity, gitUrl: gitUrl(base), gitSubdir: none(string)))
+ some((repo, base, name, version, description, maintainer, firstSubmitted, lastModified,
+ outOfDate, votes, popularity, gitUrl(base), none(string)))
else:
none(RpcPackageInfo)
@@ -113,11 +111,11 @@ proc getAurPackageInfos*(pkgs: seq[string], repo: string, arch: string, useTimeo
let infos = lc[x | (y <- parsed, x <- y.infos), PackageInfo]
let errors = lc[x | (y <- parsed, x <- y.error), string]
- let table = infos.map(i => (i.name, i)).toTable
+ let table = infos.map(i => (i.rpc.name, i)).toTable
let pkgInfos = lc[x | (p <- pkgs, x <- table.opt(p)), PackageInfo]
let names = rpcInfos.map(i => i.name).toSet
- let additionalPkgInfos = infos.filter(i => not (i.name in names))
+ let additionalPkgInfos = infos.filter(i => not (i.rpc.name in names))
(pkgInfos, additionalPkgInfos, errors)