From: Zac Medico Date: Sun, 27 Apr 2008 00:26:28 +0000 (-0000) Subject: Add a PackageVirtualDbapi.copy() method. (trunk r9982) X-Git-Tag: v2.1.5~139 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=188501f16e6b76deedbce00990f677ccb861572c;p=portage.git Add a PackageVirtualDbapi.copy() method. (trunk r9982) svn path=/main/branches/2.1.2/; revision=9988 --- diff --git a/bin/emerge b/bin/emerge index 27b8ddc2e..456f6f4cd 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1652,6 +1652,15 @@ class PackageVirtualDbapi(portage.dbapi): self._cp_map = {} self._cpv_map = {} + def copy(self): + obj = PackageVirtualDbapi(self.settings) + obj._match_cache = self._match_cache.copy() + obj._cp_map = self._cp_map.copy() + for k, v in obj._cp_map.iteritems(): + obj._cp_map[k] = v[:] + obj._cpv_map = self._cpv_map.copy() + return obj + def __contains__(self, item): existing = self._cpv_map.get(item.cpv) if existing is not None and \