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
This commit is contained in:
Faik Uygur
2007-09-24 09:09:17 +00:00
parent 0a56068b8f
commit e5687096cb
+12 -2
View File
@@ -637,8 +637,18 @@ def filter_latest_packages(package_paths):
name, version = parse_package_name(os.path.basename(path[:-len(ctx.const.package_suffix)])) name, version = parse_package_name(os.path.basename(path[:-len(ctx.const.package_suffix)]))
if latest.has_key(name): if latest.has_key(name):
if pisi.version.Version(latest[name][2]) < pisi.version.Version(version): l_version = pisi.version.Version(latest[name][2])
latest[name] = (root, name, version) 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: else:
if version: if version:
latest[name] = (root, name, version) latest[name] = (root, name, version)