summaryrefslogtreecommitdiffstats
path: root/main/apk-tools/0001-version-fix-comparision-of-pre-suffixes.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-10-26 14:12:59 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-10-26 14:12:59 +0000
commitfbddf9cf8b355e70a55da329f0b6129e67b5449a (patch)
treeabe695af5b6acc1ce72838d7d28c7454269e6fd1 /main/apk-tools/0001-version-fix-comparision-of-pre-suffixes.patch
parent74332a6e3f71e259b4f240bb6684dd47eca21ed9 (diff)
downloadaports-fbddf9cf8b355e70a55da329f0b6129e67b5449a.tar.bz2
aports-fbddf9cf8b355e70a55da329f0b6129e67b5449a.tar.xz
main/apk-tools: upgade to 2.0_rc6 + 2 patches
Diffstat (limited to 'main/apk-tools/0001-version-fix-comparision-of-pre-suffixes.patch')
-rw-r--r--main/apk-tools/0001-version-fix-comparision-of-pre-suffixes.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/main/apk-tools/0001-version-fix-comparision-of-pre-suffixes.patch b/main/apk-tools/0001-version-fix-comparision-of-pre-suffixes.patch
new file mode 100644
index 00000000..ad42d466
--- /dev/null
+++ b/main/apk-tools/0001-version-fix-comparision-of-pre-suffixes.patch
@@ -0,0 +1,45 @@
+From cc4644a54e4bb92507f957832647d91f7f91c21b Mon Sep 17 00:00:00 2001
+From: Timo Teras <timo.teras@iki.fi>
+Date: Mon, 26 Oct 2009 09:33:12 +0200
+Subject: [PATCH 1/2] version: fix comparision of pre-suffixes
+
+got broke in 0b9bfa8d52ea7ec2cae562a71932a9cc6e2b9963 which
+fixed another corner case. hopefully it's good now. fixes #191.
+---
+ src/version.c | 17 ++++++++++++++---
+ 1 files changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/src/version.c b/src/version.c
+index 97b87a6..4253042 100644
+--- a/src/version.c
++++ b/src/version.c
+@@ -207,12 +207,23 @@ int apk_version_compare_blob(apk_blob_t a, apk_blob_t b)
+ if (av > bv)
+ return APK_VERSION_GREATER;
+
+- /* at and bt are the next expected token type */
++ /* both have TOKEN_END or TOKEN_INVALID next? */
+ if (at == bt)
+ return APK_VERSION_EQUAL;
+- if (at < bt || bt == TOKEN_INVALID)
++
++ /* leading version components and their values are equal,
++ * now the non-terminating version is greater unless it's a suffix
++ * indicating pre-release */
++ if (at == TOKEN_SUFFIX && get_token(&at, &a) < 0)
++ return APK_VERSION_LESS;
++ if (bt == TOKEN_SUFFIX && get_token(&bt, &b) < 0)
+ return APK_VERSION_GREATER;
+- return APK_VERSION_LESS;
++ if (at == TOKEN_END)
++ return APK_VERSION_LESS;
++ if (bt == TOKEN_END)
++ return APK_VERSION_GREATER;
++
++ return APK_VERSION_EQUAL;
+ }
+
+ int apk_version_compare(const char *str1, const char *str2)
+--
+1.6.5
+