aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2016-07-22 04:32:12 -0500
committerWilliam Pitcock <nenolod@dereferenced.org>2017-05-27 21:34:05 +0000
commitee5ce7284aef8679fabcf728dd5bd5a17c965798 (patch)
tree87f99259f27b82dc826e5520087d52255bc128a8 /src
parent18f7aa9e44aadac834f7c16bf85bf94353367c0a (diff)
downloadaports-ee5ce7284aef8679fabcf728dd5bd5a17c965798.tar.bz2
aports-ee5ce7284aef8679fabcf728dd5bd5a17c965798.tar.xz
version: consider pkg-rX and pkg to be the same version
Diffstat (limited to 'src')
-rw-r--r--src/version.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/version.c b/src/version.c
index 00c78d125f..eaac762cb9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -218,6 +218,11 @@ int apk_version_compare_blob(apk_blob_t a, apk_blob_t b)
if (at == bt)
return APK_VERSION_EQUAL;
+ /* if only difference is pkgrev, they are equal. */
+ if ((at == TOKEN_REVISION_NO && bt == TOKEN_END) ||
+ (at == TOKEN_END && bt == TOKEN_REVISION_NO))
+ return APK_VERSION_EQUAL;
+
/* leading version components and their values are equal,
* now the non-terminating version is greater unless it's a suffix
* indicating pre-release */