aboutsummaryrefslogtreecommitdiff
path: root/load/load.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-01-30 15:18:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-01-30 15:18:51 +0200
commite5ba67bb11b55c1f3d48762ff17762d231b2361c (patch)
tree8e3a744d0ed2aa12a99c0c9a66171fb800fb8c9d /load/load.cxx
parentea06607fd65dcf820b462c5d648e2c7e5a04ca02 (diff)
Ignore version revision in package dependencies resolution
Diffstat (limited to 'load/load.cxx')
-rw-r--r--load/load.cxx34
1 files changed, 23 insertions, 11 deletions
diff --git a/load/load.cxx b/load/load.cxx
index 9e6ee5d..e2a318c 100644
--- a/load/load.cxx
+++ b/load/load.cxx
@@ -591,20 +591,32 @@ resolve_dependencies (package& p, database& db)
{
auto c (*d.constraint);
- if (c.min_version)
+ if (c.min_version && c.max_version && *c.min_version == *c.max_version)
{
- if (c.min_open)
- q = q && vm > *c.min_version;
- else
- q = q && vm >= *c.min_version;
+ const version& v (*c.min_version);
+ q = q && compare_version_eq (vm, v, v.revision != 0);
}
-
- if (c.max_version)
+ else
{
- if (c.max_open)
- q = q && vm < *c.max_version;
- else
- q = q && vm <= *c.max_version;
+ if (c.min_version)
+ {
+ const version& v (*c.min_version);
+
+ if (c.min_open)
+ q = q && compare_version_gt (vm, v, v.revision != 0);
+ else
+ q = q && compare_version_ge (vm, v, v.revision != 0);
+ }
+
+ if (c.max_version)
+ {
+ const version& v (*c.max_version);
+
+ if (c.max_open)
+ q = q && compare_version_lt (vm, v, v.revision != 0);
+ else
+ q = q && compare_version_le (vm, v, v.revision != 0);
+ }
}
}