summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-05-04 06:39:58 +0000
committerZac Medico <zmedico@gentoo.org>2008-05-04 06:39:58 +0000
commit5ca20ab70b14710b605cc0f80048150e667a11eb (patch)
treeda477d41a43cd1f4e0e0511d0d46d895583d03d0 /pym
parent1af7a4f0dbf0dd31206776b0d3bfb8910cd263b4 (diff)
downloadportage-5ca20ab70b14710b605cc0f80048150e667a11eb.tar.gz
portage-5ca20ab70b14710b605cc0f80048150e667a11eb.tar.bz2
portage-5ca20ab70b14710b605cc0f80048150e667a11eb.zip
Do more validation of resume data from the mtimedb.
svn path=/main/trunk/; revision=10165
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/__init__.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 96158c8c6..0042a6072 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -7743,12 +7743,24 @@ def action_build(settings, trees, mtimedb,
# validate the state of the resume data
# so that we can make assumptions later.
for k in ("resume", "resume_backup"):
- if k in mtimedb:
- if "mergelist" in mtimedb[k]:
- if not mtimedb[k]["mergelist"]:
- del mtimedb[k]
- else:
- del mtimedb[k]
+ if k not in mtimedb:
+ continue
+ resume_data = mtimedb[k]
+ if not isinstance(resume_data, dict):
+ del mtimedb[k]
+ continue
+ mergelist = resume_data.get("mergelist")
+ if not isinstance(mergelist, list):
+ del mtimedb[k]
+ continue
+ resume_opts = resume_data.get("myopts")
+ if not isinstance(resume_opts, (dict, list)):
+ del mtimedb[k]
+ continue
+ favorites = resume_data.get("favorites")
+ if not isinstance(resume_opts, list):
+ del mtimedb[k]
+ continue
resume = False
if "--resume" in myopts and \