- fix upgrade problem (#489)
This commit is contained in:
+10
-3
@@ -280,11 +280,18 @@ def upgrade_pkg_names(A):
|
|||||||
continue
|
continue
|
||||||
(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)
|
||||||
if ignore_build or (not build):
|
|
||||||
|
# First check version. If they are same, check release. Again
|
||||||
|
# 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)
|
||||||
elif build < pkg.build:
|
if release == pkg.release and build and not ignore_build:
|
||||||
Ap.append(x)
|
if build < pkg.build:
|
||||||
|
Ap.append(x)
|
||||||
else:
|
else:
|
||||||
#ctx.ui.info('Package %s cannot be upgraded. ' % x)
|
#ctx.ui.info('Package %s cannot be upgraded. ' % x)
|
||||||
ctx.ui.info('Package %s is already at its latest version %s,\
|
ctx.ui.info('Package %s is already at its latest version %s,\
|
||||||
|
|||||||
@@ -48,5 +48,8 @@ class VersionTestCase(unittest.TestCase):
|
|||||||
self.assert_(v1 < v3)
|
self.assert_(v1 < v3)
|
||||||
self.assert_(v2 < v3)
|
self.assert_(v2 < v3)
|
||||||
|
|
||||||
|
v1 = version.Version("pisi-1.0_alpha1")
|
||||||
|
v2 = version.Version("pisi-1.0_alpha2")
|
||||||
|
self.assert_(v2 > v1)
|
||||||
|
|
||||||
suite = unittest.makeSuite(VersionTestCase)
|
suite = unittest.makeSuite(VersionTestCase)
|
||||||
|
|||||||
Reference in New Issue
Block a user