From: Zac Medico Date: Fri, 22 Jun 2007 01:16:07 +0000 (-0000) Subject: Check if entries contain the required hashes before writing the Manifest (trunk r5902) X-Git-Tag: v2.1.3~184 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a1a2ff51d1c29ff041896fb638b5e588bfbca968;p=portage.git Check if entries contain the required hashes before writing the Manifest (trunk r5902) svn path=/main/branches/2.1.2/; revision=6926 --- 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()