From d125243edc87a4bc961c7976f73fb2248050effb Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Mon, 22 Oct 2018 16:07:40 +0300 Subject: Replace package info object tree with tuples --- src/aur.nim | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/aur.nim') 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) -- cgit v1.2.3-70-g09d2