From 1a1fbf466bec90d8c28fb29b3cafc70480ffa4f2 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 12 May 2006 11:22:30 +0200 Subject: * UpdateManager/UpdateManager.py: - strip the epoch in the changelog download code --- UpdateManager/UpdateManager.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'UpdateManager/UpdateManager.py') diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 3f556aea..61eea023 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -145,17 +145,24 @@ class MyCache(apt.Cache): #print changelog.read() # do only get the lines that are new alllines = "" - regexp = "^%s \((.*)\)(.*)$" % (srcpkg) + regexp = "^%s \((.*)\)(.*)$" % (re.escape(srcpkg)) i=0 while True: line = changelog.readline() - #print line + print line if line == "": break match = re.match(regexp,line) if match: - if apt_pkg.VersionCompare(match.group(1),pkg.installedVersion) <= 0: + # FIXME: the installed version can have a epoch, but th + # changelog does not have one, we do a dumb + # approach here and just strip it away, but I'm + # sure that this can lead to problems + installed = pkg.installedVersion + if ":" in installed: + installed = installed.split(":",1)[1] + if apt_pkg.VersionCompare(match.group(1),installed) <= 0: break # EOF (shouldn't really happen) alllines = alllines + line -- cgit v1.2.3