aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-10-08 15:30:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-10-08 15:30:57 +0200
commita0cb025c91a1a8258dc5e9fb641330ebde9b133a (patch)
treeeeda8e4a3742e2930e6d368401cb62358d9094da
parent9c8ab2b8902e65fb3538e1f93c3b53f92901b0d2 (diff)
Fix satisfies() function
-rw-r--r--bpkg/satisfaction3
-rw-r--r--bpkg/satisfaction.cxx12
2 files changed, 8 insertions, 7 deletions
diff --git a/bpkg/satisfaction b/bpkg/satisfaction
index 2200688..f250e4b 100644
--- a/bpkg/satisfaction
+++ b/bpkg/satisfaction
@@ -23,7 +23,8 @@ namespace bpkg
}
// Return true if any version that satisfies l also satisfies r, or, in
- // other words, l is stricter than or equal to r.
+ // other words, l is stricter than or equal to r. Or, in yet other words,
+ // l is a subset of r.
//
bool
satisfies (const dependency_constraint& l, const dependency_constraint& r);
diff --git a/bpkg/satisfaction.cxx b/bpkg/satisfaction.cxx
index 0631b83..d3ba789 100644
--- a/bpkg/satisfaction.cxx
+++ b/bpkg/satisfaction.cxx
@@ -53,9 +53,9 @@ namespace bpkg
{
switch (ro)
{
- case op::eq: return rv < lv;
- case op::lt: return rv <= lv;
- case op::le: return rv < lv;
+ case op::eq: return lv < rv;
+ case op::lt: return lv <= rv;
+ case op::le: return lv < rv;
case op::gt:
case op::ge: return false;
}
@@ -64,9 +64,9 @@ namespace bpkg
{
switch (ro)
{
- case op::eq: return rv <= lv;
- case op::lt: return rv < lv;
- case op::le: return rv <= lv;
+ case op::eq: return lv <= rv;
+ case op::lt: return lv < rv;
+ case op::le: return lv <= rv;
case op::gt:
case op::ge: return false;
}