--- UpdateManager.epoch 2006-05-24 16:14:21.000000000 +0100 +++ UpdateManager.py 2006-06-23 23:41:27.000000000 +0100 @@ -146,26 +146,38 @@ # do only get the lines that are new alllines = "" regexp = "^%s \((.*)\)(.*)$" % (re.escape(srcpkg)) + re_version = re.compile(regexp) i=0 - while True: - line = changelog.readline() - #print line - if line == "": - break - match = re.match(regexp,line) - if match: - # 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 installed and ":" in installed: - installed = installed.split(":",1)[1] - if installed and apt_pkg.VersionCompare(match.group(1),installed) <= 0: + installed = pkg.installedVersion + #print installed + # if we have no version number don't do version parsing because + # we will show the full log anyway + if not installed: + alllines = changelog.read() + else: + # 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 + if ":" in installed: + installed = installed.split(":",1)[1] + while True: + line = changelog.readline() + #print line + if line == "": break - # EOF (shouldn't really happen) - alllines = alllines + line + match = re_version.match(line) + if match: + changelogver = match.group(1) + # strip off the epoch + if ":" in changelogver: + changelogver = changelogver.split(":",1)[1] + + if apt_pkg.VersionCompare(changelogver,installed) <= 0: + break + # EOF (shouldn't really happen) + alllines = alllines + line # only write if we where not canceld if lock.locked():