summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-22 01:16:07 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-22 01:16:07 +0000
commita1a2ff51d1c29ff041896fb638b5e588bfbca968 (patch)
tree69b243f9feb758082f5883a93f8d84a5e81efad7 /pym
parent541fe32abf6204b5b38860473fe025330904f0ba (diff)
downloadportage-a1a2ff51d1c29ff041896fb638b5e588bfbca968.tar.gz
portage-a1a2ff51d1c29ff041896fb638b5e588bfbca968.tar.bz2
portage-a1a2ff51d1c29ff041896fb638b5e588bfbca968.zip
Check if entries contain the required hashes before writing the Manifest (trunk r5902)
svn path=/main/branches/2.1.2/; revision=6926
Diffstat (limited to 'pym')
-rw-r--r--pym/portage_manifest.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pym/portage_manifest.py b/pym/portage_manifest.py
index 6645963dd..c0f8bef9d 100644
--- a/pym/portage_manifest.py
+++ b/pym/portage_manifest.py
@@ -344,8 +344,15 @@ 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()