createrepo cache and checksum type
Axel Thimm <[email protected]>
| Newsgroups | gmane.linux.rpm.metadata |
|---|---|
| Message-ID | <[email protected]> |
Hi,
it looks like the current cache implementation doesn't distinguish
between different checksum types, so when switching back and forth
between sha and sha256 checksum types createrepo may pick up the wrong
checksum.
(You may ask why on earth would one switch back and forth, and for
example I use createrepo 0.9.7 on RHEL5 package production machines
and everything is sha256 and happy internally, but when creating
metadata for external consumers < F11 the checksums need to become
plain sha again).
Anyway I think the following or something similar should be OK:
createrepo/yumbased.py~ 2009-04-15 17:17:31.000000000 +0200
createrepo/yumbased.py 2009-04-17 17:37:15.000000000 +0200
@@ -64,8 +64,8 @@
kcsum.update("".join(t))
key = kcsum.hexdigest()
- csumtag = '%s-%s-%s-%s' % (os.path.basename(self.localpath),
- key, self.size, self.filetime)
+ csumtag = '%s-%s-%s-%s-%s' % (os.path.basename(self.localpath),
+ key, self.size, self.filetime, self.checksum_type)
csumfile = '%s/%s' % (self._cachedir, csumtag)
if os.path.exists(csumfile) and float(self.filetime) <= float(os.stat(csumfile)[-2]):
The "key" is computed with the default checksum type which may not be
the same as self.checksum_type, and in fact depends on the presence
and quality of hashlib, so maybe for consistency one should compute
"key" with self.checksum_type as well.
Thanks!
--
Axel.Thimm at ATrpms.net
_______________________________________________
Rpm-metadata mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/rpm-metadata
signature.asc
(application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknoqoIACgkQQBVS1GOamfH9MwCeLILZo6h8BvD397wZZkxEXMEF Jr4An03K+/yVZj2reaSIXdoB4vVc1GGs =R6zf -----END PGP SIGNATURE-----