From e8addd60ff509f92ed1a52feb4f66022c0ec9da5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 30 Jul 2007 04:42:00 +0000 Subject: [PATCH] Some minor fixes for manifest code (branches/2.1.2 r6923) svn path=/main/branches/2.1.2.9/; revision=7476 --- pym/portage_manifest.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/pym/portage_manifest.py b/pym/portage_manifest.py index cdccbd9fa..6645963dd 100644 --- a/pym/portage_manifest.py +++ b/pym/portage_manifest.py @@ -79,7 +79,8 @@ class ManifestEntry(object): class Manifest1Entry(ManifestEntry): def __str__(self): - for hashkey in self.hashes: + myhashkeys = self.hashes.keys() + for hashkey in myhashkeys: if hashkey != "size": break hashvalue = self.hashes[hashkey] @@ -343,15 +344,8 @@ class Manifest(object): except FileNotFound: pass - def checkIntegrity(self): - for t in self.fhashdict: - for f in self.fhashdict[t]: - if portage_const.MANIFEST2_REQUIRED_HASH not in self.fhashdict[t][f]: - raise MissingParameter("Missing %s checksum: %s %s" % (portage_const.MANIFEST2_REQUIRED_HASH, t, f)) - def write(self, sign=False, force=False): """ Write Manifest instance to disk, optionally signing it """ - self.checkIntegrity() try: if self.compat: self._writeDigests() @@ -488,12 +482,12 @@ class Manifest(object): except OSError: pass if f in distfilehashes and \ - not required_hash_types.difference(distfilehashes[f]) and \ ((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 \ - distfilehashes[f]["size"] == mystat.st_size)): + distfilehashes[f]["size"] == mystat.st_size)) and \ + not required_hash_types.difference(distfilehashes[f]): self.fhashdict["DIST"][f] = distfilehashes[f] else: try: -- 2.26.2