summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
authorSebastian Heinlein <sebi@glatzor.de>2008-08-24 21:59:17 +0200
committerSebastian Heinlein <sebi@glatzor.de>2008-08-24 21:59:17 +0200
commit07edbff3df9d15403256f1ef6d8e4bc92433182e (patch)
treed0e68089dd1e92b40cebe66ded18d72f361b7fe5 /apt
parente671440114f46b0c6a961cd995a0b7d8bfb3f2ba (diff)
downloadpython-apt-07edbff3df9d15403256f1ef6d8e4bc92433182e.tar.gz
Make version compare constants available globally and rename them for more consistency.
Diffstat (limited to 'apt')
-rw-r--r--apt/debfile.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/apt/debfile.py b/apt/debfile.py
index b5d2fea7..9545ca98 100644
--- a/apt/debfile.py
+++ b/apt/debfile.py
@@ -30,6 +30,12 @@ from gettext import gettext as _
from cache import Cache
from progress import DpkgInstallProgress
+# Constants for comparing the local package file with the version in the cache
+(VERSION_NONE,
+ VERSION_OUTDATED,
+ VERSION_SAME,
+ VERSION_NEWER) = range(4)
+
class NoDebArchiveException(IOError):
pass
@@ -313,12 +319,7 @@ class DebPackage(object):
res = False
return res
- # some constants
- (NO_VERSION,
- VERSION_OUTDATED,
- VERSION_SAME,
- VERSION_IS_NEWER) = range(4)
-
+
def compareToVersionInCache(self, useInstalled=True):
""" checks if the pkg is already installed or availabe in the cache
and if so in what version, returns if the version of the deb
@@ -337,12 +338,12 @@ class DebPackage(object):
cmp = apt_pkg.VersionCompare(cachever,debver)
self._dbg(1, "CompareVersion(debver,instver): %s" % cmp)
if cmp == 0:
- return self.VERSION_SAME
+ return VERSION_SAME
elif cmp < 0:
- return self.VERSION_IS_NEWER
+ return VERSION_NEWER
elif cmp > 0:
- return self.VERSION_OUTDATED
- return self.NO_VERSION
+ return VERSION_OUTDATED
+ return VERSION_NONE
def checkDeb(self):
self._dbg(3,"checkDepends")