requestsync: Use debian_bundle.changelog.Version for version comparison in debian_changelog. Fixes cases where the current ubuntu version is not in debian anymore, e.g. p7zip-rar 4.55~ds.1-2

This commit is contained in:
Daniel Hahler 2008-02-09 18:29:09 +01:00
parent 5401bffe45
commit befa4c0850
2 changed files with 10 additions and 3 deletions

4
debian/changelog vendored
View File

@ -11,8 +11,10 @@ ubuntu-dev-tools (0.26) UNRELEASED; urgency=low
When interaction is not required, ask the user if she wants to edit.
(LP: #190351)
* Exit, if versions in Ubuntu and Debian are the same already.
* Use debian_bundle.changelog.Version for version comparison in
debian_changelog.
-- Daniel Hahler <ubuntu@thequod.de> Sat, 09 Feb 2008 02:23:44 +0100
-- Daniel Hahler <ubuntu@thequod.de> Sat, 09 Feb 2008 18:27:06 +0100
ubuntu-dev-tools (0.25) hardy; urgency=low

View File

@ -10,6 +10,7 @@
# License: GPLv2, see /usr/share/common-licenses/GPL
import os, sys, urllib, subprocess, getopt
from debian_bundle.changelog import Version
def cur_version_component(sourcepkg, release):
'''Determine current package version in ubuntu.'''
@ -54,13 +55,17 @@ def debian_changelog(sourcepkg, component, version):
'''Return the Debian changelog from the latest up to the given version
(exclusive).'''
base_version = Version(version)
ch = ''
subdir = sourcepkg[0]
if sourcepkg.startswith('lib'):
subdir = 'lib%s' % sourcepkg[3]
for l in urllib.urlopen('http://packages.debian.org/changelogs/pool/%s/%s/%s/current/changelog.txt' % (component, subdir, sourcepkg)):
if l.startswith(sourcepkg) and l.find(version + ')') > 0:
break
if l.startswith(sourcepkg):
ch_version = l[ l.find("(")+1 : l.find(")") ]
if Version(ch_version) <= base_version:
break
ch += l
return ch