From e5687096cbe9be8279a42fed314ad7f9febbf7cd Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Mon, 24 Sep 2007 09:09:17 +0000 Subject: [PATCH] If version format changes in repo (20070204->0.2.3) and repo also keeps the old packages than only use the build nos BUG:FIXED:6352 --- pisi/util.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pisi/util.py b/pisi/util.py index 50296fbc..fa7fdb83 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -637,8 +637,18 @@ def filter_latest_packages(package_paths): name, version = parse_package_name(os.path.basename(path[:-len(ctx.const.package_suffix)])) if latest.has_key(name): - if pisi.version.Version(latest[name][2]) < pisi.version.Version(version): - latest[name] = (root, name, version) + l_version = pisi.version.Version(latest[name][2]) + r_version = pisi.version.Version(version) + + # Bug 6352 + # If version format changes in repo and a repo also keeps the old packages (bad.bad.bad.) + # than only use the build nos + if l_version.build and r_version.build: + if l_version.build < r_version.build: + latest[name] = (root, name, version) + else: + if l_version < r_version: + latest[name] = (root, name, version) else: if version: latest[name] = (root, name, version)