Comment 5 for bug 331935

Revision history for this message
Axel Thimm (axel-thimm) wrote : Re: SHA256 checksum for rpm-md/apt-deb

The following patch on top of the patch in comment #3 seems to be needed:

--- smart/cache.py 2009-02-20 12:34:05 +0000
+++ smart/cache.py 2009-04-16 12:20:41.000000000 +0200
@@ -211,7 +211,7 @@
                     raise Error, _("Invalid MD5 (expected %s, got %s)") % \
                                  (filemd5, lfilemd5)
             else:
- filesha256 = item.getInfo(uncompprefix+"sha256")
+ filesha256 = self.getSHA256(url)
                 if filesha256:
                     try:
                         from hashlib import sha256
@@ -225,7 +225,6 @@
                         if lfilesha256 != filesha256:
                            raise Error, _("Invalid SHA256 (expected %s, got %s)") % \
                                          (filesha256, lfilesha256)
- return
                     except ImportError:
                         pass
                 filesha = self.getSHA(url)
--- smart/fetcher.py 2009-02-20 13:26:02 +0000
+++ smart/fetcher.py 2009-04-16 12:20:26.000000000 +0200
@@ -398,7 +398,6 @@
                         if lfilesha256 != filesha256:
                            raise Error, _("Invalid SHA256 (expected %s, got %s)") % \
                                          (filesha256, lfilesha256)
- return
                     except ImportError:
                         pass
                 filesha = item.getInfo(uncompprefix+"sha")

The resulting patch against 1.2 looks like the attached one.