Bug#473254: python-debian: deb822 should use lowercase/uppercase like official Release files
Julian Andres Klode
jak at jak-linux.org
Sat Mar 29 16:06:57 UTC 2008
Adeodato Simó wrote:
> * Julian Andres Klode [Sat, 29 Mar 2008 16:31:20 +0100]:
>
>> Please change fields like md5sums to MD5Sums, sha1 to SHA1 and sha256 to SHA256,
>> so Release files created by python-debian look more like official Release files.
>
> Have you tried, when creating those files, giving the names to deb822 in
> the casing you *want*? I think it should work just fine.
>
> If it doesn't, we'll look into it.
>
> Cheers,
>
Of course I have.
Look here: release822 = Release(); release822['MD5Sum'] = md5sums
The problem is in __init__:
def __init__(self, *args, **kwargs):
Deb822.__init__(self, *args, **kwargs)
for field, fields in self._multivalued_fields.items():
try:
contents = self[field]
except KeyError:
continue
if self.isMultiLine(contents):
self[field] = []
updater_method = self[field].append
else:
self[field] = Deb822Dict()
updater_method = self[field].update
for line in filter(None, contents.splitlines()):
updater_method(Deb822Dict(zip(fields, line.split())))
Here, deb822 automatically registers the lower case values, which were given to
it in the lines:
class Release(_multivalued):
_multivalued_fields = {
"md5sum": [ "md5sum", "size", "name" ],
"sha1": [ "sha1", "size", "name" ],
"sha256": [ "sha256", "size", "name" ],
}
--
Julian Andres Klode, Fellow of the Free Software Foundation Europe
Debian Maintainer | Developer | Ubuntu Member
try Debian: http://www.debian.org/ | my site: http://jak-linux.org/
jabber: juliank at jabber.org | IRC: juliank (FreeNode, OFTC)
languages: German | English
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-python-debian-maint/attachments/20080329/5c64e3af/attachment.pgp
More information about the pkg-python-debian-maint
mailing list