From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QLmZr-0007CF-D3 for garchives@archives.gentoo.org; Mon, 16 May 2011 01:26:31 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 32F1E1C099; Mon, 16 May 2011 01:26:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 048C01C099 for ; Mon, 16 May 2011 01:26:22 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6A04B1B401A for ; Mon, 16 May 2011 01:26:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id AD62D80504 for ; Mon, 16 May 2011 01:26:21 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dbapi/vartree.py X-VCS-Directories: pym/portage/dbapi/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: b2e26ba79e1ef41594d1ec1bb032acf7fb6a1403 Date: Mon, 16 May 2011 01:26:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 9734bfb65808d74dadb082f613ebc78a commit: b2e26ba79e1ef41594d1ec1bb032acf7fb6a1403 Author: Zac Medico gentoo org> AuthorDate: Mon May 16 01:25:59 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon May 16 01:25:59 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Db2e26ba7 preserve-libs: lock vardb for removeFromContents --- pym/portage/dbapi/vartree.py | 31 ++++++++++++++++++++----------- 1 files changed, 20 insertions(+), 11 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 4d7e6b8..cae8cd0 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1548,10 +1548,14 @@ class dblink(object): unmerge_no_replacement) if cpv_lib_map: self._remove_preserved_libs(cpv_lib_map) - for cpv, removed in cpv_lib_map.items(): - if not self.vartree.dbapi.cpv_exists(cpv): - continue - self.vartree.dbapi.removeFromContents(cpv, removed) + self.vartree.dbapi.lock() + try: + for cpv, removed in cpv_lib_map.items(): + if not self.vartree.dbapi.cpv_exists(cpv): + continue + self.vartree.dbapi.removeFromContents(cpv, removed) + finally: + self.vartree.dbapi.unlock() =20 plib_registry.store() finally: @@ -3524,12 +3528,19 @@ class dblink(object): # same cpv then the vdb entry no longer belongs # to it, so we'll have to get the slot and counter # from plib_registry._data instead. + self.vartree.dbapi.lock() try: - slot, counter =3D self.vartree.dbapi.aux_get( - cpv, ["SLOT", "COUNTER"]) - has_vdb_entry =3D True - except KeyError: - pass + try: + slot, counter =3D self.vartree.dbapi.aux_get( + cpv, ["SLOT", "COUNTER"]) + except KeyError: + pass + else: + has_vdb_entry =3D True + self.vartree.dbapi.removeFromContents( + cpv, paths) + finally: + self.vartree.dbapi.unlock() =20 if not has_vdb_entry: # It's possible for previously unmerged packages @@ -3553,8 +3564,6 @@ class dblink(object): =20 remaining =3D [f for f in plib_dict[cpv] if f not in paths] plib_registry.register(cpv, slot, counter, remaining) - if has_vdb_entry: - self.vartree.dbapi.removeFromContents(cpv, paths) =20 plib_registry.store() finally: