From 5b9e9d1bb12a636f06da47c138446f3ac4ac7476 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 23 May 2008 18:51:58 +0000 Subject: [PATCH] Bug #220671 - Fix 'RuntimeError: Set changed size during iteration' error. svn path=/main/trunk/; revision=10388 --- pym/portage/dbapi/vartree.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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))) -- 2.26.2