Support for finding changelog.Debian.gz in perl-base

Simon Ruggier simon80 at gmail.com
Thu Jun 15 00:08:41 UTC 2017


Hi all, thanks for making it easy to manipulate Debian packages in Python
code. Debian's perl packages in testing have an unusual layout: the perl
package has only an upstream changelog, while the changelog.Debian.gz is at
/usr/share/doc/perl/changelog.Debian.gz within the perl-base package. Right
now, DebFile fails to find the changelog, because it's looking for it at
/usr/share/doc/perl-base/changelog.Debian.gz.

To support this configuration without adding a special case for perl-base,
I propose checking /usr/share/doc/<source package name>/changelog.Debian.gz
before checking the native changelog path.

In the future, if any packages are more unusual than this, I think the next
step would be to iterate over all of the files in the package looking for
/usr/share/doc/*/changelog.Debian.gz, but I didn't want to potentially harm
performance, so I didn't go that far.

I've attached two patches with cleanups near the code involved, as well as
a third patch that implements this suggestion. I've tested the updated code
on my system and successfully parsed changelog files out of both perl-base
and other packages that implement normal changelog parsing.

Cheers,
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-python-debian-maint/attachments/20170614/6592fb6e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Remove-trailing-whitespace-from-debfile.py.patch
Type: text/x-patch
Size: 1083 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-python-debian-maint/attachments/20170614/6592fb6e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-debfile-Use-with-statement-to-open-GzipFile-object.patch
Type: text/x-patch
Size: 1005 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-python-debian-maint/attachments/20170614/6592fb6e/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Try-finding-changelog-files-via-the-source-package-n.patch
Type: text/x-patch
Size: 2173 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-python-debian-maint/attachments/20170614/6592fb6e/attachment-0002.bin>


More information about the pkg-python-debian-maint mailing list