diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-05-19 15:25:53 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-05-19 15:25:53 +0200 |
| commit | d55ec0082540e99d520426bb73d3443f2175213b (patch) | |
| tree | 463fad96ffbfbc92b210c6d0599deb51fd58ae80 | |
| parent | 6acb0019d19c01a1861c41cf0d846a42a0af481b (diff) | |
| download | python-apt-d55ec0082540e99d520426bb73d3443f2175213b.tar.gz | |
Merge a patch from Sebastian Heinlein to make get_changelog() only
check sources where source version >= binary version (Closes: #581831).
| -rw-r--r-- | apt/package.py | 25 | ||||
| -rw-r--r-- | debian/changelog | 2 |
2 files changed, 10 insertions, 17 deletions
diff --git a/apt/package.py b/apt/package.py index 817dfd55..fb79d043 100644 --- a/apt/package.py +++ b/apt/package.py @@ -1010,30 +1010,21 @@ class Package(object): # get the source version, start with the binaries version bin_ver = self.candidate.version src_ver = self.candidate.version - #print "bin: %s" % binver try: - # FIXME: This try-statement is too long ... # try to get the source version of the pkg, this differs # for some (e.g. libnspr4 on ubuntu) # this feature only works if the correct deb-src are in the - # sources.list - # otherwise we fall back to the binary version number + # sources.list otherwise we fall back to the binary version number src_records = apt_pkg.SourceRecords() - src_rec = src_records.lookup(src_pkg) - if src_rec: + except SystemError: + pass + else: + while src_records.lookup(src_pkg): + if not src_records.version or \ + apt_pkg.version_compare(bin_ver, src_records.version) > 0: + continue src_ver = src_records.version - #if apt_pkg.VersionCompare(binver, srcver) > 0: - # srcver = binver - if not src_ver: - src_ver = bin_ver - #print "srcver: %s" % src_ver section = src_records.section - #print "srcsect: %s" % section - else: - # fail into the error handler - raise SystemError - except SystemError: - src_ver = bin_ver section_split = section.split("/", 1) if len(section_split) > 1: diff --git a/debian/changelog b/debian/changelog index 426606aa..22418888 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,8 @@ python-apt (0.7.95) UNRELEASED; urgency=low * apt/package.py: - Decode using utf-8 in installed_files (LP: #407953). - Fix fetch_source() to work when source name = binary name (LP: #552400). + - Merge a patch from Sebastian Heinlein to make get_changelog() only + check sources where source version >= binary version (Closes: #581831). * python: - Return bool instead of int to Python where possible, looks better. - Document every class, function, property. |
