diff options
author | kitsunyan | 2018-05-07 16:01:10 +0000 |
---|---|---|
committer | kitsunyan | 2018-05-07 16:01:10 +0000 |
commit | 9b5a3059c0b123e7f6dd70ab2d88c79b75c88745 (patch) | |
tree | af43cf4e261bdfddb25062a77eb038b57c7f7fdd /src/package.nim | |
parent | 285700719d68891532c3714255ac3e3b3d2870d3 (diff) |
Add support for "--nodeps" and "--assume-installed" options
Diffstat (limited to 'src/package.nim')
-rw-r--r-- | src/package.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/package.nim b/src/package.nim index 046f22c..1171374 100644 --- a/src/package.nim +++ b/src/package.nim @@ -173,9 +173,9 @@ proc checkConstraints(lop: ConstraintOperation, rop: ConstraintOperation, cmp: i a(2) or a(1) or a(0) or a(-1) or a(-2) -proc isProvidedBy*(package: PackageReference, by: PackageReference): bool = +proc isProvidedBy*(package: PackageReference, by: PackageReference, checkVersions: bool): bool = if package.name == by.name: - if package.constraint.isNone or by.constraint.isNone: + if not checkVersions or package.constraint.isNone or by.constraint.isNone: true else: let lcon = package.constraint.unsafeGet @@ -273,7 +273,7 @@ proc parseSrcInfoName(repo: string, name: string, baseIndex: int, baseCount: int proc filterReferences(references: seq[PackageReference], filterWith: seq[PackageReference]): seq[PackageReference] = - references.filter(r => filterWith.filter(w => r.isProvidedBy(w)).len == 0) + references.filter(r => filterWith.filter(w => r.isProvidedBy(w, true)).len == 0) let base = lc[x.value | (x <- baseSeq[], x.key == "pkgbase"), string].optLast |