aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}