aboutsummaryrefslogtreecommitdiff
path: root/load
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-09-03 00:18:20 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-09-05 16:57:22 +0300
commit2d907a525ab169f1cb97b87550e3646fde003733 (patch)
treefd6c820702a6a064bd6265d661ff77120064ac7c /load
parent32a92bfa9ca270f262b34b6cfc82825d84f9026c (diff)
Adapt to optional package revision
Diffstat (limited to 'load')
-rw-r--r--load/load.cxx22
1 files changed, 16 insertions, 6 deletions
diff --git a/load/load.cxx b/load/load.cxx
index 57acb3a..c786551 100644
--- a/load/load.cxx
+++ b/load/load.cxx
@@ -860,13 +860,19 @@ resolve_dependencies (package& p, database& db)
assert (c.complete ());
- query qs (compare_version_eq (vm, wildcard_version, false));
+ query qs (compare_version_eq (vm,
+ canonical_version (wildcard_version),
+ false /* revision */));
if (c.min_version && c.max_version &&
*c.min_version == *c.max_version)
{
const version& v (*c.min_version);
- q = q && (compare_version_eq (vm, v, v.revision != 0) || qs);
+ q = q &&
+ (compare_version_eq (vm,
+ canonical_version (v),
+ v.revision.has_value ()) ||
+ qs);
}
else
{
@@ -875,21 +881,25 @@ resolve_dependencies (package& p, database& db)
if (c.min_version)
{
const version& v (*c.min_version);
+ canonical_version cv (v);
+ bool rv (v.revision);
if (c.min_open)
- qr = compare_version_gt (vm, v, v.revision != 0);
+ qr = compare_version_gt (vm, cv, rv);
else
- qr = compare_version_ge (vm, v, v.revision != 0);
+ qr = compare_version_ge (vm, cv, rv);
}
if (c.max_version)
{
const version& v (*c.max_version);
+ canonical_version cv (v);
+ bool rv (v.revision);
if (c.max_open)
- qr = qr && compare_version_lt (vm, v, v.revision != 0);
+ qr = qr && compare_version_lt (vm, cv, rv);
else
- qr = qr && compare_version_le (vm, v, v.revision != 0);
+ qr = qr && compare_version_le (vm, cv, rv);
}
q = q && (qr || qs);