aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-status.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-08-30 20:56:26 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-09-05 16:55:45 +0300
commit1ad6dad8da0d51e9522f9d27cf48531fa23b24ba (patch)
tree4f53f85678348e605d282bad20b327653faa0729 /bpkg/pkg-status.cxx
parent7b5a0b55569331560f9cb6439ee818c3ce5d8428 (diff)
Adapt to optional package revision
Diffstat (limited to 'bpkg/pkg-status.cxx')
-rw-r--r--bpkg/pkg-status.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/bpkg/pkg-status.cxx b/bpkg/pkg-status.cxx
index aaaedaf..bfba21f 100644
--- a/bpkg/pkg-status.cxx
+++ b/bpkg/pkg-status.cxx
@@ -86,9 +86,9 @@ namespace bpkg
//
if (!p.version.empty ())
q = q && compare_version_eq (query::id.version,
- p.version,
- p.version.revision != 0,
- false);
+ canonical_version (p.version),
+ p.version.revision.has_value (),
+ false /* iteration */);
// And if we found an existing package, then only look for versions
// greater than to what already exists unless we were asked to show
@@ -98,7 +98,7 @@ namespace bpkg
// available versions (since it is 0).
//
if (s != nullptr && !o.old_available ())
- q = q && query::id.version > s->version;
+ q = q && query::id.version > canonical_version (s->version);
q += order_by_version_desc (query::id.version);
@@ -281,7 +281,9 @@ namespace bpkg
{
const char* arg (args.next ());
package p {parse_package_name (arg),
- parse_package_version (arg),
+ parse_package_version (arg,
+ false /* allow_wildcard */,
+ false /* fold_zero_revision */),
nullptr /* selected */,
nullopt /* constraint */};
@@ -292,9 +294,9 @@ namespace bpkg
if (!p.version.empty ())
q = q && compare_version_eq (query::version,
- p.version,
- p.version.revision != 0,
- false);
+ canonical_version (p.version),
+ p.version.revision.has_value (),
+ false /* iteration */);
p.selected = db.query_one<selected_package> (q);
}