From: Zac Medico Date: Fri, 23 May 2008 18:51:58 +0000 (-0000) Subject: Bug #220671 - Fix 'RuntimeError: Set changed size during iteration' error. X-Git-Tag: v2.2_pre8~126 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5b9e9d1bb12a636f06da47c138446f3ac4ac7476;p=portage.git Bug #220671 - Fix 'RuntimeError: Set changed size during iteration' error. svn path=/main/trunk/; revision=10388 --- diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index f1923b17f..a5d73843a 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1779,7 +1779,9 @@ class dblink(object): # inject files that should be preserved into our image dir import shutil missing_paths = [] - for x in candidates: + candidates_stack = list(candidates) + while candidates_stack: + x = candidates_stack.pop() # skip existing files so the 'new' libs aren't overwritten if os.path.exists(os.path.join(srcroot, x.lstrip(os.sep))): missing_paths.append(x) @@ -1802,6 +1804,7 @@ class dblink(object): if linktarget[0] != os.sep: linktarget = os.path.join(os.path.dirname(x), linktarget) candidates.add(linktarget) + candidates_stack.append(linktarget) else: shutil.copy2(os.path.join(destroot, x.lstrip(os.sep)), os.path.join(srcroot, x.lstrip(os.sep)))