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 1QZgZL-0004bV-53 for garchives@archives.gentoo.org; Thu, 23 Jun 2011 09:51:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5BA3E1C065; Thu, 23 Jun 2011 09:51:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0E21C1C065 for ; Thu, 23 Jun 2011 09:51:11 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6268D1B4023 for ; Thu, 23 Jun 2011 09:51:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 9396A80048 for ; Thu, 23 Jun 2011 09:51:10 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <58264d1e8b875fc00796c2055e40209247ec2e43.mgorny@gentoo> Subject: [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: PMSTestSuite/pm/pkgcorepm.py X-VCS-Directories: PMSTestSuite/pm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 58264d1e8b875fc00796c2055e40209247ec2e43 Date: Thu, 23 Jun 2011 09:51:10 +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: 7d1c66eaaf28005a838f894ec283d92b commit: 58264d1e8b875fc00796c2055e40209247ec2e43 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Thu Jun 23 09:41:40 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Thu Jun 23 09:41:40 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3D58264d1e pkgcore: support grabbing metadata of vardb. --- PMSTestSuite/pm/pkgcorepm.py | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/PMSTestSuite/pm/pkgcorepm.py b/PMSTestSuite/pm/pkgcorepm.py index eece213..e4e680a 100644 --- a/PMSTestSuite/pm/pkgcorepm.py +++ b/PMSTestSuite/pm/pkgcorepm.py @@ -24,6 +24,13 @@ class PkgCorePM(PackageManager): common_pmerge_opts =3D ['--oneshot'] =20 class VDB(PackageManager.VDB): + class VDBPackage(PackageManager.VDB.VDBPackage): + def __getattr__(self, name): + return self._pkg.data[name] + + def __init__(self, pkg): + self._pkg =3D pkg + _config =3D None _vardb =3D None def _load_config(self): @@ -37,6 +44,13 @@ class PkgCorePM(PackageManager): return True return False =20 + def __getitem__(self, key): + for p in self._vardb: + if p.cpvstr =3D=3D key: + return self.VDBPackage(p) + else: + raise KeyError('Package not in VDB: %s' % key) + def __init__(self): self._load_config() =20