From a1a2ff51d1c29ff041896fb638b5e588bfbca968 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 22 Jun 2007 01:16:07 +0000 Subject: Check if entries contain the required hashes before writing the Manifest (trunk r5902) svn path=/main/branches/2.1.2/; revision=6926 --- pym/portage_manifest.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pym/portage_manifest.py') 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() -- cgit v1.2.3-1-g7c22