Re: [arch-general] [arch-dev-public] [PATCH] Check all checksum types
On Tue, Jun 8, 2010 at 2:33 AM, Allan McRae <allan@archlinux.org> wrote:
Check every checksum that makepkg supports rather than only md5sums. Fixes FS#17168.
Signed-off-by: Allan McRae <allan@archlinux.org> ---
I am sure there has to be some way to loop through all that duplication, but the how escapes me...
getattr? What about the attached implementation of checksums.py? Note: I dont tested it! -- «Dans la vie, rien n'est à craindre, tout est à comprendre» Marie Sklodowska Curie.
On Tue, Jun 8, 2010 at 1:00 PM, Kazuo Teramoto <kaz.rag@gmail.com> wrote:
On Tue, Jun 8, 2010 at 2:33 AM, Allan McRae <allan@archlinux.org> wrote:
Check every checksum that makepkg supports rather than only md5sums. Fixes FS#17168.
Signed-off-by: Allan McRae <allan@archlinux.org> ---
I am sure there has to be some way to loop through all that duplication, but the how escapes me...
getattr?
What about the attached implementation of checksums.py? Note: I dont tested it!
Did you attach anything ?
On Tue, Jun 8, 2010 at 8:09 AM, Xavier Chantry <chantry.xavier@gmail.com> wrote:
Did you attach anything ?
Yes, I dont forget! I cant put it on the body, because I'm using the gmail web interface (and it break lines), but I put a base 64 of it is at end and is at http://fma.if.usp.br/~kazuo/checksums.py and http://paste.pocoo.org/show/223156/ (sha256 bc140424f5c6c4d7b9d41a8ba8feb077ee261492357fba8e423efe6a707aa6a9) =====base 64 start====== IyAKIyBuYW1jYXAgcnVsZXMgLSBjaGVja3N1bXMKIyBDb3B5cmlnaHQgKEMpIDIwMDMtMjAwOSBK YXNvbiBDaHUgPGphc29uQGFyY2hsaW51eC5vcmc+CiMgCiMgICBUaGlzIHByb2dyYW0gaXMgZnJl ZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeQojICAgaXQg dW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJs aXNoZWQgYnkKIyAgIHRoZSBGcmVlIFNvZnR3YXJlIE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SkKCgkJcmV0dXJuIHJldAoJZGVm IHR5cGUoc2VsZik6CgkJcmV0dXJuICJwa2didWlsZCIKIyB2aW06IHNldCB0cz00IHN3PTQgbm9l dDoK =====base 64 end====== -- «Dans la vie, rien n'est à craindre, tout est à comprendre» Marie Sklodowska Curie.
On 08/06/10 21:09, Xavier Chantry wrote:
On Tue, Jun 8, 2010 at 1:00 PM, Kazuo Teramoto<kaz.rag@gmail.com> wrote:
On Tue, Jun 8, 2010 at 2:33 AM, Allan McRae<allan@archlinux.org> wrote:
Check every checksum that makepkg supports rather than only md5sums. Fixes FS#17168.
Signed-off-by: Allan McRae<allan@archlinux.org> ---
I am sure there has to be some way to loop through all that duplication, but the how escapes me...
getattr?
What about the attached implementation of checksums.py? Note: I dont tested it!
Did you attach anything ?
I think attachments get stripped to this list. But getattr does indeed look like what I want... Allan
participants (3)
-
Allan McRae
-
Kazuo Teramoto
-
Xavier Chantry