aboutsummaryrefslogtreecommitdiff
path: root/src/package.nim
diff options
context:
space:
mode:
authorkitsunyan2018-06-02 07:08:15 +0000
committerkitsunyan2018-06-02 07:08:15 +0000
commit3d420e1b546c5636e38653cb21d5dc0f4306a30a (patch)
tree81e36d88d29ec1114a908e81769ecb066830e2c4 /src/package.nim
parent3edef649597b7669bd67b1e42680ac25068debc7 (diff)
Allow to query virtual packages using "-Qdttt"
Diffstat (limited to 'src/package.nim')
-rw-r--r--src/package.nim11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/package.nim b/src/package.nim
index bc55c3a..3e2c6f7 100644
--- a/src/package.nim
+++ b/src/package.nim
@@ -12,7 +12,8 @@ type
VersionConstraint* = tuple[
operation: ConstraintOperation,
- version: string
+ version: string,
+ impliedVersion: bool
]
PackageReference* = tuple[
@@ -195,13 +196,13 @@ proc toPackageReference*(dependency: ptr AlpmDependency): PackageReference =
else: none(ConstraintOperation)
let description = if dependency.desc != nil: some($dependency.desc) else: none(string)
- ($dependency.name, description, op.map(o => (o, $dependency.version)))
+ ($dependency.name, description, op.map(o => (o, $dependency.version, false)))
template toPackageReference*(pkg: ptr AlpmPackage): PackageReference =
- ($pkg.name, none(string), some((ConstraintOperation.eq, $pkg.version)))
+ ($pkg.name, none(string), some((ConstraintOperation.eq, $pkg.version, false)))
template toPackageReference*(pkg: RpcPackageInfo): PackageReference =
- (pkg.name, none(string), some((ConstraintOperation.eq, pkg.version)))
+ (pkg.name, none(string), some((ConstraintOperation.eq, pkg.version, false)))
proc parsePackageReference*(name: string, withDescription: bool): PackageReference =
var matches: array[3, string]
@@ -217,7 +218,7 @@ proc parsePackageReference*(name: string, withDescription: bool): PackageReferen
let index = constraints.map(s => $s).find(matches[1])
if index >= 0:
- (matches[0], description, some((constraints[index], matches[2])))
+ (matches[0], description, some((constraints[index], matches[2], false)))
else:
(matches[0], description, none(VersionConstraint))
else: