Clone cached match results before returning them from portdbapi.xmatch(). Thanks...
authorZac Medico <zmedico@gentoo.org>
Sun, 24 Dec 2006 20:03:22 +0000 (20:03 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 24 Dec 2006 20:03:22 +0000 (20:03 -0000)
svn path=/main/trunk/; revision=5382

pym/portage.py

index 243a5c79ceef29008212fc7b753e91f76e24630c..a2970b2b45315ef1086355ad8fa249235a6ed76e 100644 (file)
@@ -5688,7 +5688,7 @@ class portdbapi(dbapi):
                #if no updates are being made to the tree, we can consult our xcache...
                if self.frozen:
                        try:
-                               return self.xcache[level][origdep]
+                               return self.xcache[level][origdep][:]
                        except KeyError:
                                pass
 
@@ -5732,7 +5732,7 @@ class portdbapi(dbapi):
                        self.xcache[level][mydep]=myval
                        if origdep and origdep != mydep:
                                self.xcache[level][origdep] = myval
-               return myval
+               return myval[:]
 
        def match(self,mydep,use_cache=1):
                return self.xmatch("match-visible",mydep)