diff options
Diffstat (limited to 'src/package.nim')
-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] |