diff options
author | kitsunyan | 2018-04-14 14:38:20 +0000 |
---|---|---|
committer | kitsunyan | 2018-04-14 14:38:20 +0000 |
commit | d884cac14c0dc2dfb713f2aa307d54fa32695ee4 (patch) | |
tree | 105cfcfcdc10bda955a7359fc34a76721b15d9b9 /src | |
parent | c291a892f7c70b31ea3246a971ced66ce52cfcd3 (diff) |
Extract arrays only for pkgname instead of pkgbase & pkgname
Diffstat (limited to 'src')
-rw-r--r-- | src/package.nim | 10 |
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] |