diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-05-12 11:22:30 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-05-12 11:22:30 +0200 |
| commit | 1a1fbf466bec90d8c28fb29b3cafc70480ffa4f2 (patch) | |
| tree | 1fcf168934722ae8cb81853aa40b4fe54a1c2771 /UpdateManager/UpdateManager.py | |
| parent | 49ac4006ec43c8a3989192110aeec8c139d80196 (diff) | |
| download | python-apt-1a1fbf466bec90d8c28fb29b3cafc70480ffa4f2.tar.gz | |
* UpdateManager/UpdateManager.py:
- strip the epoch in the changelog download code
Diffstat (limited to 'UpdateManager/UpdateManager.py')
| -rw-r--r-- | UpdateManager/UpdateManager.py | 13 |
1 files changed, 10 insertions, 3 deletions
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 |
