From: Michael Tremer Date: Sat, 19 Mar 2011 17:40:40 +0000 (+0100) Subject: Take distribution tag into account when comparing packages. X-Git-Tag: 0.9.3~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=420809ae00e84928a4a212b56ea73385062f59f0;p=pakfire.git Take distribution tag into account when comparing packages. --- diff --git a/pakfire/packages/util.py b/pakfire/packages/util.py index ae918410b..d3fd01602 100644 --- a/pakfire/packages/util.py +++ b/pakfire/packages/util.py @@ -23,10 +23,16 @@ def version_compare_release(r1, r2): return 0 if "." in r1: - r1 = r1.split(".")[0] + r1, d1 = r1.split(".", 1) if "." in r2: - r2 = r2.split(".")[0] + r2, d2 = r2.split(".", 1) + + # Compare the distribution tag at first. + ret = cmp(d1, d2) + + if not ret == 0: + return ret r1 = int(r1) r2 = int(r2)