diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2023-07-21 16:34:00 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2023-07-25 16:16:19 +0300 |
commit | 8468f0beac9b792d7e2621f1a78a485ed542fb1d (patch) | |
tree | ce5d3274ff6ef90361496eb0d6d81f912c14ab0e /bpkg/satisfaction.cxx | |
parent | 22716755cbdbfa9b0db1dfafe73252093132ab68 (diff) |
Ignore version iteration in satisfies() overloads (GH issue #293)
Diffstat (limited to 'bpkg/satisfaction.cxx')
-rw-r--r-- | bpkg/satisfaction.cxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/bpkg/satisfaction.cxx b/bpkg/satisfaction.cxx index cbcb5a0..4229004 100644 --- a/bpkg/satisfaction.cxx +++ b/bpkg/satisfaction.cxx @@ -34,13 +34,19 @@ namespace bpkg // if (c.min_version) { - int i (ev.compare (*c.min_version, !c.min_version->revision)); + int i (ev.compare (*c.min_version, + !c.min_version->revision, + true /* ignore_iteration */)); + s = c.min_open ? i > 0 : i >= 0; } if (s && c.max_version) { - int i (ev.compare (*c.max_version, !c.max_version->revision)); + int i (ev.compare (*c.max_version, + !c.max_version->revision, + true /* ignore_iteration */)); + s = c.max_open ? i < 0 : i <= 0; } @@ -85,7 +91,10 @@ namespace bpkg version lv (norm (*l.min_version, true /* min */, l.min_open)); version rv (norm (*r.min_version, true /* min */, r.min_open)); - int i (lv.compare (rv, false /* ignore_revision */)); + int i (lv.compare (rv, + false /* ignore_revision */, + true /* ignore_iteration */)); + if (l.min_open) // Doesn't matter if r is min_open or not. // @@ -108,7 +117,10 @@ namespace bpkg version lv (norm (*l.max_version, false /* min */, l.max_open)); version rv (norm (*r.max_version, false /* min */, r.max_open)); - int i (lv.compare (rv, false /* ignore_revision */)); + int i (lv.compare (rv, + false /* ignore_revision */, + true /* ignore_iteration */)); + if (l.max_open) // Doesn't matter if r is max_open or not. // |