* fix: correctly use build no in determining which packages may be upgraded as in api.list_upgradable. there was a really foolish code segment there :(

This commit is contained in:
Eray Özkural
2005-12-20 09:58:30 +00:00
parent 59aa948002
commit f2e892e110
+4 -11
View File
@@ -266,7 +266,7 @@ def upgrade_pkg_names(A = []):
"""Re-installs packages from the repository, trying to perform """Re-installs packages from the repository, trying to perform
a maximum number of upgrades.""" a maximum number of upgrades."""
ignore_build = ctx.config.options and ctx.config.options.ignore_build_no ignore_build = ctx.get_option('build_no')
if not A: if not A:
# if A is empty, then upgrade all packages # if A is empty, then upgrade all packages
@@ -284,19 +284,12 @@ def upgrade_pkg_names(A = []):
(version, release, build) = ctx.installdb.get_version(x) (version, release, build) = ctx.installdb.get_version(x)
pkg = packagedb.get_package(x) pkg = packagedb.get_package(x)
# First check version. If they are same, check release. Again if ignore_build or (not build):
# if releases are same and checking buildno is premitted,
# check build number.
if version < pkg.version:
Ap.append(x)
elif version == pkg.version:
if release < pkg.release: if release < pkg.release:
Ap.append(x) Ap.append(x)
if release == pkg.release and build and not ignore_build: elif build < pkg.build:
if build < pkg.build: Ap.append(x)
Ap.append(x)
else: else:
#ctx.ui.info('Package %s cannot be upgraded. ' % x)
ctx.ui.info(_('Package %s is already at its latest \ ctx.ui.info(_('Package %s is already at its latest \
version %s, release %s, build %s.') version %s, release %s, build %s.')
% (x, pkg.version, pkg.release, pkg.build)) % (x, pkg.version, pkg.release, pkg.build))