Bug#473259: python-debian: Please follow official release files for size in multivalued fields

John Wright jsw at debian.org
Thu Apr 3 01:54:51 UTC 2008


On Sat, Mar 29, 2008 at 05:02:25PM +0100, Julian Andres Klode wrote:
> Package: python-debian
> Version: 0.1.9
> Severity: low
> Tags: patch
> 
> Currently, deb822 writes multivalued fields as 'checksum size filename', whereas
> the official Release files use a specific width for the size:
> 
> The official release file:
>  d8544bb5a8a8460c2f6c5576c073066a 22586597 main/binary-amd64/Packages
>  ceda0c78baeec155fc6564737622d023       82 main/binary-amd64/Release
> 
> The same created by deb822:
>  d8544bb5a8a8460c2f6c5576c073066a 22586597 main/binary-amd64/Packages
>  ceda0c78baeec155fc6564737622d023 82 main/binary-amd64/Release
> 
> This makes the file a bit unreadable. To fix this, you just need to get the
> len() of the str(size) of every file, take the longest one and write something
> like "%8d" (if 8 is the longest size). This would produce more readable release
> files.
> 
> One should also be able to specify int() values as size. Currently deb822 only
> accepts strings, but a size is normally an integer value. The attached patch
> also fixes that issue.

Thanks for the patch.  Unfortunately, there are a couple issues...
First, other files, such as .changes and .dsc, do not follow this
convention, so the behavior should be limited to Release files.  Second,
the behavior itself isn't consistent across archive tools.  It appears
that dak behaves as you describe, making the size field as long as the
longest size.  However, apt-ftparchive makes the field 16 characters
long, regardless of the longest size.

I don't have a particular preference -- perhaps it'd be nice for the
Release class to have some attribute defining which behavior to use.  It
would also be nice for the input parser to detect this, so that a
Release object made from a Release file would dump the exact input...

I'll see what I can come up with...

-- 
John Wright <jsw at debian.org>





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