aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-status.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/pkg-status.cxx')
-rw-r--r--bpkg/pkg-status.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/bpkg/pkg-status.cxx b/bpkg/pkg-status.cxx
index c31e834..f83b610 100644
--- a/bpkg/pkg-status.cxx
+++ b/bpkg/pkg-status.cxx
@@ -66,17 +66,17 @@ namespace bpkg
query q (query::id.name == n);
- // If we found an existing package, then only look for versions
- // greater than what already exists.
+ // If the user specified the version, then only look for that
+ // specific version.
//
- if (p != nullptr)
- q = q && query::id.version > p->version;
- else if (!v.empty ())
- //
- // Otherwise, if the user specified the version, then only look for
- // that specific version.
- //
+ if (!v.empty ())
q = q && query::id.version == v;
+ //
+ // Otherwise, if we found an existing package, then only look for
+ // versions greater than what already exists.
+ //
+ else if (p != nullptr)
+ q = q && query::id.version > p->version;
q += order_by_version_desc (query::id.version);