From: Zac Medico Date: Sat, 6 Dec 2008 05:36:06 +0000 (-0000) Subject: Validate $ROOT inside the --resume merge list in order to avoid a pottential X-Git-Tag: v2.1.6~4 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=c29f452775c69506138a5227a8b42c2fc552b646;p=portage.git 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 for reporting. (trunk r12166) svn path=/main/branches/2.1.6/; revision=12167 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index f6ef588b2..8126ae7b3 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -12783,6 +12783,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]