diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-12-06 05:30:39 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-12-06 05:30:39 +0000 |
commit | 6b50e9d12afb7ba841d4d7a9fcdc6e8243e51442 (patch) | |
tree | 43d4d47c456b3ae1958e9f4fc8f3a69990a613df | |
parent | 1ee56423dc7ec88f4969598d45534fcb5255c5be (diff) | |
download | portage-6b50e9d12afb7ba841d4d7a9fcdc6e8243e51442.tar.gz portage-6b50e9d12afb7ba841d4d7a9fcdc6e8243e51442.tar.bz2 portage-6b50e9d12afb7ba841d4d7a9fcdc6e8243e51442.zip |
Validate $ROOT inside the --resume merge list in order to avoid a pottential
KeyError due to a stale merge list that was for a different $ROOT setting.
Thanks to Ned Ludd <solar@g.o> for reporting.
svn path=/main/trunk/; revision=12166
-rw-r--r-- | pym/_emerge/__init__.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 20597c053..bb9ae689d 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -13130,6 +13130,18 @@ def action_build(settings, trees, mtimedb, if not isinstance(mergelist, list): del mtimedb[k] continue + for x in mergelist: + if not (isinstance(x, list) and len(x) == 4): + continue + pkg_type, pkg_root, pkg_key, pkg_action = x + if pkg_root not in trees: + # Current $ROOT setting differs, + # so the list must be stale. + mergelist = None + break + if not mergelist: + del mtimedb[k] + continue resume_opts = resume_data.get("myopts") if not isinstance(resume_opts, (dict, list)): del mtimedb[k] |