public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
Date: Tue,  7 Jun 2011 17:16:36 +0000 (UTC)	[thread overview]
Message-ID: <421452d0ae6375db6539147e9e292ec52064617f.mgorny@gentoo> (raw)

commit:     421452d0ae6375db6539147e9e292ec52064617f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  7 17:16:43 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun  7 17:16:43 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=421452d0

pkgcore: support vardb lookups.

---
 PMSTestSuite/pm/pkgcorepm.py |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/PMSTestSuite/pm/pkgcorepm.py b/PMSTestSuite/pm/pkgcorepm.py
index 738c49b..0d64cd7 100644
--- a/PMSTestSuite/pm/pkgcorepm.py
+++ b/PMSTestSuite/pm/pkgcorepm.py
@@ -63,13 +63,24 @@ class PkgCorePM(PortagePM):
 		raise NotImplementedError('PkgCorePM does not support adding repositories yet.')
 
 	_config = None
+	_vardb = None
+	def _load_config(self):
+		from pkgcore.config import load_config
+		self._config = load_config()
+		self._vardb = self._config.repo['vdb']
+
 	@property
 	def config(self):
 		if self._config is None:
-			from pkgcore.config import load_config
-			self._config = load_config()
+			self._load_config()
 		return self._config
 
+	@property
+	def vardb(self):
+		# reload required to refresh vardb
+		self._load_config()
+		return self._vardb
+
 	def get_repository(self, name):
 		for r in self.config.repo.values():
 			if hasattr(r, 'repo_id') and r.repo_id == name:
@@ -77,5 +88,9 @@ class PkgCorePM(PortagePM):
 		else:
 			raise KeyError('Repository %s not found.' % name)
 
-	# XXX: vardb and stuff
+	def lookup_vardb(self, cpvs):
+		installed_cpvs = set([p.cpvstr for p in self.vardb])
+		installed_cpvs &= set(cpvs)
+		return installed_cpvs
+
 	# portage's get_userpriv_group() required by repoman



             reply	other threads:[~2011-06-07 17:16 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07 17:16 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-08 21:31 [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/pm/ Michał Górny
2011-08-05 19:54 Michał Górny
2011-08-05 17:09 Michał Górny
2011-08-05 17:09 Michał Górny
2011-08-03 20:17 Michał Górny
2011-08-03 20:17 Michał Górny
2011-07-31 15:10 Michał Górny
2011-06-23  9:51 [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/ Michał Górny
2011-06-23  9:51 Michał Górny
2011-06-23  9:51 Michał Górny
2011-06-23  9:51 Michał Górny
2011-06-21 21:25 Michał Górny
2011-06-21 20:58 Michał Górny
2011-06-21 20:58 Michał Górny
2011-06-21 20:58 Michał Górny
2011-06-21 20:58 Michał Górny
2011-06-21 20:58 Michał Górny
2011-06-21 17:58 Michał Górny
2011-06-21 17:54 Michał Górny
2011-06-21 17:54 Michał Górny
2011-06-21 17:54 Michał Górny
2011-06-21 17:54 Michał Górny
2011-06-21 15:26 Michał Górny
2011-06-21 15:26 Michał Górny
2011-06-20 19:20 Michał Górny
2011-06-16 19:49 Michał Górny
2011-06-16 19:49 Michał Górny
2011-06-14 12:35 Michał Górny
2011-06-07 17:16 Michał Górny
2011-06-07 15:20 Michał Górny
2011-06-07 14:54 Michał Górny
2011-06-06  7:36 Michał Górny
2011-05-31 21:06 Michał Górny
2011-05-31 19:18 Michał Górny
2011-05-31 19:18 Michał Górny
2011-05-31 12:14 Michał Górny
2011-05-31 12:14 Michał Górny
2011-05-29 18:57 Michał Górny
2011-05-29 18:57 Michał Górny
2011-05-26  9:45 Michał Górny
2011-05-25 16:24 Michał Górny
2011-05-25 16:24 Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=421452d0ae6375db6539147e9e292ec52064617f.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox