version: consider pkg-rX and pkg to be the same version

cute-signatures
A. Wilcox 2016-07-22 04:32:12 -05:00 committed by William Pitcock
parent 18f7aa9e44
commit ee5ce7284a
1 changed files with 5 additions and 0 deletions

View File

@ -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 */