aboutsummaryrefslogtreecommitdiff
path: root/src/feature/syncinfo.nim
diff options
context:
space:
mode:
authorkitsunyan2018-03-13 23:23:58 +0000
committerkitsunyan2018-03-13 23:23:58 +0000
commit67d1413bbcbb07636a3267568572b99e0c92f219 (patch)
treed03ad0740f6a6d64d4a820ddaec82d3968181ba3 /src/feature/syncinfo.nim
parenteedc8ca25aa95ffd152fe9fc3b4946e7ebe0d917 (diff)
Perform arch filter during .SRCINFO parsing
Diffstat (limited to 'src/feature/syncinfo.nim')
-rw-r--r--src/feature/syncinfo.nim14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/feature/syncinfo.nim b/src/feature/syncinfo.nim
index 3c64282..5ff6b38 100644
--- a/src/feature/syncinfo.nim
+++ b/src/feature/syncinfo.nim
@@ -37,15 +37,11 @@ const
]
proc formatDeps(title: string, config: Config,
- refs: seq[ArchPackageReference]): PackageLineFormat =
- proc formatDep(reference: ArchPackageReference): (string, bool) =
- reference.reference.description
- .map(d => ($reference.reference & ": " & d, true))
- .get(($reference.reference, false))
-
+ refs: seq[PackageReference]): PackageLineFormat =
let values: seq[tuple[title: string, hasDesc: bool]] = refs
- .filter(r => r.arch.isNone or r.arch == some(config.arch))
- .map(formatDep)
+ .map(r => r.description
+ .map(d => ($r & ": " & d, true))
+ .get(($r, false)))
if values.len > 0:
(title, values.map(v => v.title), values.map(v => v.hasDesc).foldl(a or b))
@@ -110,7 +106,7 @@ proc handleSyncInfo*(args: seq[Argument], config: Config): int =
findSyncTargets(handle, dbs, targets, false, false)
let (pkgInfos, aerrors) = getAurPackageInfo(checkAur, none(seq[RpcPackageInfo]),
- proc (a: int, b: int) = discard)
+ config.arch, proc (a: int, b: int) = discard)
for e in aerrors: printError(config.color, e)
let fullTargets = mapAurTargets[PackageInfo](syncTargets, pkgInfos)