rpm/rpm-4.4.4-rpmvercmp.patch

19 lines
818 B
Diff
Raw Permalink Normal View History

diff -pur rpm-4.4.4/lib/rpmvercmp.c rpm-4.4.4-qilinux/lib/rpmvercmp.c
--- rpm-4.4.4/lib/rpmvercmp.c 2005-07-04 04:32:22.000000000 +0200
+++ rpm-4.4.4-qilinux/lib/rpmvercmp.c 2006-01-04 16:04:28.000000000 +0100
@@ -108,6 +108,14 @@ int rpmvercmp(const char * a, const char
/*@-boundsread@*/
if ((!*one) && (!*two)) return 0;
+ /* take care of rc, alpha, and beta version numbers */
+ while (*one && *one == '-') one++;
+ if (!strncmp(one, "rc", 2) || !strncmp(one, "alpha", 5) || !strncmp(one, "beta", 4))
+ return -1;
+ while (*two && *two == '-') two++;
+ if (!strncmp(two, "rc", 2) || !strncmp(two, "alpha", 5) || !strncmp(two, "beta", 4))
+ return +1;
+
/* whichever version still has characters left over wins */
if (!*one) return -1; else return 1;
/*@=boundsread@*/