From 188501f16e6b76deedbce00990f677ccb861572c Mon Sep 17 00:00:00 2001
From: Zac Medico <zmedico@gentoo.org>
Date: Sun, 27 Apr 2008 00:26:28 +0000
Subject: [PATCH] Add a PackageVirtualDbapi.copy() method. (trunk r9982)

svn path=/main/branches/2.1.2/; revision=9988
---
 bin/emerge | 9 +++++++++
 1 file changed, 9 insertions(+)

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 \
-- 
2.26.2