aboutsummaryrefslogtreecommitdiff
path: root/src/package.nim
diff options
context:
space:
mode:
authorkitsunyan2018-04-14 14:38:20 +0000
committerkitsunyan2018-04-14 14:38:20 +0000
commitd884cac14c0dc2dfb713f2aa307d54fa32695ee4 (patch)
tree105cfcfcdc10bda955a7359fc34a76721b15d9b9 /src/package.nim
parentc291a892f7c70b31ea3246a971ced66ce52cfcd3 (diff)
Extract arrays only for pkgname instead of pkgbase & pkgname
Diffstat (limited to 'src/package.nim')
-rw-r--r--src/package.nim10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/package.nim b/src/package.nim
index c3ab6f4..70fe2eb 100644
--- a/src/package.nim
+++ b/src/package.nim
@@ -215,10 +215,16 @@ proc parseSrcInfoName(repo: string, name: string, baseIndex: int, baseCount: int
rpcInfos: seq[RpcPackageInfo], baseSeq: ref seq[SrcInfoPair], nameSeq: ref seq[SrcInfoPair],
arch: string, gitUrl: string, gitBranch: Option[string], gitCommit: Option[string],
gitPath: Option[string]): Option[PackageInfo] =
- let pairs = baseSeq[] & nameSeq[]
- proc collect(keyName: string): seq[string] =
+ proc collectFromPairs(pairs: seq[SrcInfoPair], keyName: string): seq[string] =
lc[x.value | (x <- pairs, x.key == keyName), string]
+ proc collect(keyName: string): seq[string] =
+ let res = collectFromPairs(nameSeq[], keyName)
+ if res.len == 0:
+ collectFromPairs(baseSeq[], keyName)
+ else:
+ res
+
proc splitConstraint(name: string): PackageReference =
var matches: array[3, string]