Manifest.create(): tweak assume-digests code
authorZac Medico <zmedico@gentoo.org>
Sun, 2 Oct 2011 23:43:27 +0000 (16:43 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 2 Oct 2011 23:43:27 +0000 (16:43 -0700)
If we have a local file, before we assume that we don't need to compute
any digests, make sure that the pre-computed digest types are exactly
the same types that we desire.

pym/portage/manifest.py

index 9db8acc1eb23113fb82143357ed092bd75cff807..d09de260699ec21379c9efb0f4ddfa4ccb64c057 100644 (file)
@@ -387,7 +387,7 @@ class Manifest(object):
                                ((assumeDistHashesSometimes and mystat is None) or \
                                (assumeDistHashesAlways and mystat is None) or \
                                (assumeDistHashesAlways and mystat is not None and \
-                               len(distfilehashes[f]) == len(self.hashes) and \
+                               set(distfilehashes[f]) == set(self.hashes) and \
                                distfilehashes[f]["size"] == mystat.st_size)):
                                self.fhashdict["DIST"][f] = distfilehashes[f]
                        else: