From: Michael Tremer Date: Sun, 20 Mar 2011 14:47:56 +0000 (+0100) Subject: Another fix for version comparison if we have no distro tag. X-Git-Tag: 0.9.3~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=413be138cdfed68a19e76bb43a7547debaa9443b;p=pakfire.git Another fix for version comparison if we have no distro tag. --- diff --git a/pakfire/packages/util.py b/pakfire/packages/util.py index aed239e43..4a00630d1 100644 --- a/pakfire/packages/util.py +++ b/pakfire/packages/util.py @@ -31,10 +31,11 @@ def version_compare_release(r1, r2): r2, d2 = r2.split(".", 1) # Compare the distribution tag at first. - ret = cmp(d1, d2) + if d1 and d2: + ret = cmp(d1, d2) - if not ret == 0: - return ret + if not ret == 0: + return ret r1 = int(r1) r2 = int(r2) @@ -133,6 +134,7 @@ def test_parse_pkg_expr(): "gcc>4.0.0-1", "gcc<4.0.0-1", "gcc<=4.0.0-1", + "openssl-devel>=1.0.0d-2", ) for s in strings: