public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-05-25 16:24 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-05-25 16:24 UTC (permalink / raw
  To: gentoo-commits

commit:     1a379e673441e5f4b9e6a7c6fe133fdbda59ae01
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 16:24:37 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 25 16:24:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=1a379e67

Distinguish between installed and non-installed PMs.

---
 PMSTestSuite/pm/__init__.py |   22 ++++++++++++++++++----
 PMSTestSuite/pm/portage.py  |    6 ++++++
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 9980659..27df2fa 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -4,8 +4,10 @@
 
 """
 >>> pms = get_package_managers()
->>> 'portage' in [str(x) for x in pms]
+>>> 'portage' in [x.name for x in pms]
 True
+>>> str(pms[0]) # doctest: +ELLIPSIS
+'...'
 """
 
 class PackageManager(object):
@@ -28,8 +30,13 @@ class PackageManager(object):
 		raise NotImplementedError('Please override the pkg property.')
 
 	@classmethod
-	def is_available(self):
-		pass
+	def is_available(cls):
+		"""
+		Check whether a particular PM is installed and executable.
+
+		Returns True if the PM is available, False otherwise.
+		"""
+		raise NotImplementedError('Please override the is_available class method.')
 
 def get_package_managers():
 	""" Return the list of supported Package Managers. """
@@ -42,8 +49,15 @@ def get_package_managers():
 			""" Instantiate the wrapper for PM class <pmclass>. """
 			self._pmclass = pmclass
 
+		@property
+		def name(self):
+			""" The name of associated PM. """
+			return self._pmclass.name
+
 		def __str__(self):
-			""" Return the name of associated PM. """
+			""" Return the human-readable name of associated PM. """
+			if not self._pmclass.is_available():
+				return '(%s)' % self._pmclass.name
 			return self._pmclass.name
 
 	return [PMWrapper(x) for x in (PortagePM,)]

diff --git a/PMSTestSuite/pm/portage.py b/PMSTestSuite/pm/portage.py
index 5c8abd8..7a21593 100644
--- a/PMSTestSuite/pm/portage.py
+++ b/PMSTestSuite/pm/portage.py
@@ -2,9 +2,15 @@
 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
+import os
+
 from PMSTestSuite.pm import PackageManager
 
 class PortagePM(PackageManager):
 	""" A class implementing the interfaces to the Portage PM. """
 	name = 'portage'
 	pkg = 'sys-apps/portage'
+
+	@classmethod
+	def is_available(cls):
+		return os.access('/usr/bin/emerge', os.X_OK)



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-05-25 16:24 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-05-25 16:24 UTC (permalink / raw
  To: gentoo-commits

commit:     273dd4357b25ff9996ce02808395e5e0a2e903b4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 15:59:13 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 25 15:59:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=273dd435

Doc PMSTestSuite.pm better.

---
 PMSTestSuite/pm/__init__.py |   27 ++++++++++++++++++++-------
 PMSTestSuite/pm/portage.py  |    1 +
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 6a3cc38..9980659 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -11,26 +11,39 @@ True
 class PackageManager(object):
 	"""
 	Base class for various package managers support.
-
-	Package manager subclasses should define the following attrs:
-	- name - human-readable PM name (for option values),
-	- pkg - the full name (category/pn) of the package installing a particular
-		Package Manager (for help messages),
-	- ...
 	"""
 
+	@property
+	def name(self):
+		""" Human-readable, short PM name (used in option values). """
+		raise NotImplementedError('Please override the name property.')
+
+	@property
+	def pkg(self):
+		"""
+		The full package name (in a format suitable for passing to a Package
+		Manager, e.g. category/pn) for the package installing a particular
+		Package Manager.
+		"""
+		raise NotImplementedError('Please override the pkg property.')
+
 	@classmethod
-	def is_available(cls):
+	def is_available(self):
 		pass
 
 def get_package_managers():
+	""" Return the list of supported Package Managers. """
+
 	from PMSTestSuite.pm.portage import PortagePM
 
 	class PMWrapper(object):
+		""" A wrapper class which stringifies into a name of particular PM. """
 		def __init__(self, pmclass):
+			""" Instantiate the wrapper for PM class <pmclass>. """
 			self._pmclass = pmclass
 
 		def __str__(self):
+			""" Return the name of associated PM. """
 			return self._pmclass.name
 
 	return [PMWrapper(x) for x in (PortagePM,)]

diff --git a/PMSTestSuite/pm/portage.py b/PMSTestSuite/pm/portage.py
index e3174d4..5c8abd8 100644
--- a/PMSTestSuite/pm/portage.py
+++ b/PMSTestSuite/pm/portage.py
@@ -5,5 +5,6 @@
 from PMSTestSuite.pm import PackageManager
 
 class PortagePM(PackageManager):
+	""" A class implementing the interfaces to the Portage PM. """
 	name = 'portage'
 	pkg = 'sys-apps/portage'



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-05-26  9:45 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-05-26  9:45 UTC (permalink / raw
  To: gentoo-commits

commit:     7db2f02288ebcad988119a2ea50169052c450e6e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 09:43:12 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu May 26 09:43:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=7db2f022

Add a more extensive test for PM availability.

---
 PMSTestSuite/pm/portage.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/PMSTestSuite/pm/portage.py b/PMSTestSuite/pm/portage.py
index 51770b1..c63fd49 100644
--- a/PMSTestSuite/pm/portage.py
+++ b/PMSTestSuite/pm/portage.py
@@ -16,7 +16,15 @@ class PortagePM(PackageManager):
 
 	@classmethod
 	def is_available(cls):
-		return os.access(cls.emerge_path, os.X_OK)
+		try:
+			import portage
+		except ImportError:
+			return False
+		
+		ret = True
+		for prog in (cls.emerge_path, cls.repoman_path):
+			ret &= os.access(prog, os.X_OK)
+		return ret
 
 	def remanifest(self, paths):
 		for path in paths:



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-05-29 18:57 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-05-29 18:57 UTC (permalink / raw
  To: gentoo-commits

commit:     eb3225fbda2b972f372bcdef63a83777f25d081e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun May 29 18:42:05 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun May 29 18:42:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=eb3225fb

Implement minimal PortagePM.merge().

---
 PMSTestSuite/pm/portage.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/PMSTestSuite/pm/portage.py b/PMSTestSuite/pm/portage.py
index c63fd49..8326856 100644
--- a/PMSTestSuite/pm/portage.py
+++ b/PMSTestSuite/pm/portage.py
@@ -30,3 +30,7 @@ class PortagePM(PackageManager):
 		for path in paths:
 			os.chdir(path)
 			subprocess.check_call([self.repoman_path, 'manifest'])
+
+	def merge(self, atoms):
+		ret = subprocess.call([self.emerge_path] + atoms)
+		return ret == 0



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-05-29 18:57 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-05-29 18:57 UTC (permalink / raw
  To: gentoo-commits

commit:     a7a0ed61a9b96b62a9d428e693bbf1c12c901fb4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun May 29 18:52:17 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun May 29 18:52:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=a7a0ed61

Return to start directory after creating Manifests.

---
 PMSTestSuite/pm/portage.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/PMSTestSuite/pm/portage.py b/PMSTestSuite/pm/portage.py
index 8a7763f..d31bd44 100644
--- a/PMSTestSuite/pm/portage.py
+++ b/PMSTestSuite/pm/portage.py
@@ -29,9 +29,11 @@ class PortagePM(PackageManager):
 		return ret
 
 	def remanifest(self, paths):
+		startdir = os.getcwd()
 		for path in paths:
 			os.chdir(path)
 			subprocess.check_call([self.repoman_path, 'manifest'])
+		os.chdir(startdir)
 
 	def merge(self, atoms):
 		ret = subprocess.call([self.emerge_path] + atoms,



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-05-31 12:14 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-05-31 12:14 UTC (permalink / raw
  To: gentoo-commits

commit:     2b9753789b6c7bd44347cec9721c7ce39c8f8515
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 31 11:31:41 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 31 11:31:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=2b975378

PMSTestSuite.pm.portage -> portagepm to avoid namespace collision.

---
 PMSTestSuite/pm/__init__.py                  |    2 +-
 PMSTestSuite/pm/{portage.py => portagepm.py} |    0
 2 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 9a2d5ed..d3bd434 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -74,7 +74,7 @@ class PackageManager(object):
 def get_package_managers():
 	""" Return the list of supported Package Managers. """
 
-	from PMSTestSuite.pm.portage import PortagePM
+	from PMSTestSuite.pm.portagepm import PortagePM
 
 	class PMWrapper(object):
 		""" A wrapper class which stringifies into a name of particular PM. """

diff --git a/PMSTestSuite/pm/portage.py b/PMSTestSuite/pm/portagepm.py
similarity index 100%
rename from PMSTestSuite/pm/portage.py
rename to PMSTestSuite/pm/portagepm.py



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-05-31 12:14 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-05-31 12:14 UTC (permalink / raw
  To: gentoo-commits

commit:     5a7d32196d0045b90835ef80a2fecb78125d3c39
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 31 11:40:05 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 31 11:40:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=5a7d3219

Support vdb lookups.

---
 PMSTestSuite/pm/__init__.py  |   10 ++++++++++
 PMSTestSuite/pm/portagepm.py |   18 ++++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index d3bd434..9838822 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -71,6 +71,16 @@ class PackageManager(object):
 		"""
 		raise NotImplementedError('Please override the unmerge() method.')
 
+	def lookup_vardb(self, cpvs):
+		"""
+		Lookup the vardb checking whether the packages listed in <cpvs>
+		are installed. The elements of iterable passed as <cpvs> shall be in CPV
+		form, i.e. category/pn-pv.
+
+		Returns an iterable of packages actually merged (a subset of <cpvs>).
+		"""
+		raise NotImplementedError('Please override the lookup_vardb() method.')
+
 def get_package_managers():
 	""" Return the list of supported Package Managers. """
 

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index 71672c0..9d5fa0b 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -44,3 +44,21 @@ class PortagePM(PackageManager):
 		ret = subprocess.call([self.emerge_path, '--unmerge'] + self.pm_options + atoms,
 				env = {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)})
 		return ret == 0
+
+	_vardb = None
+	@property
+	def vardb(self):
+		if not self._vardb:
+			from portage import create_trees
+			trees = create_trees(
+					config_root = os.environ.get('PORTAGE_CONFIGROOT'),
+					target_root = os.environ.get('ROOT'))
+			tree = trees[max(trees)]
+			self._vardb = tree['vartree'].dbapi
+
+		return self._vardb
+
+	def lookup_vardb(self, cpvs):
+		installed_cpvs = set(self.vardb.cpv_all())
+		installed_cpvs &= set(cpvs)
+		return installed_cpvs



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-05-31 19:18 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-05-31 19:18 UTC (permalink / raw
  To: gentoo-commits

commit:     420241209ece14404946645b9675c953322c29d8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 31 19:15:34 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 31 19:15:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=42024120

Add a few defaults options to emerge.

---
 PMSTestSuite/pm/portagepm.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index 768ff23..e1ad442 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -14,6 +14,8 @@ class PortagePM(PackageManager):
 	emerge_path = '/usr/bin/emerge'
 	repoman_path = '/usr/bin/repoman'
 
+	common_emerge_opts = ['--ask', 'n', '--keep-going']
+
 	repo_paths = []
 
 	@classmethod
@@ -36,7 +38,8 @@ class PortagePM(PackageManager):
 		os.chdir(startdir)
 
 	def spawn_emerge(self, cpvs, opts = []):
-		return subprocess.Popen([self.emerge_path] + opts + self.pm_options
+		return subprocess.Popen([self.emerge_path]
+				+ self.common_emerge_opts + opts + self.pm_options
 				+ ['=%s' % cpv for cpv in cpvs],
 				env = {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)})
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-05-31 19:18 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-05-31 19:18 UTC (permalink / raw
  To: gentoo-commits

commit:     ff8ceaa0d7f2b2ea2bde774d980ace0c141b7241
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 31 19:13:35 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 31 19:13:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=ff8ceaa0

Commonize emerge spawning code.

---
 PMSTestSuite/pm/portagepm.py |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index 4b1e751..768ff23 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -35,11 +35,15 @@ class PortagePM(PackageManager):
 			subprocess.check_call([self.repoman_path, 'manifest'])
 		os.chdir(startdir)
 
-	def call_emerge(self, cpvs, opts = []):
-		return subprocess.call([self.emerge_path] + opts + self.pm_options
+	def spawn_emerge(self, cpvs, opts = []):
+		return subprocess.Popen([self.emerge_path] + opts + self.pm_options
 				+ ['=%s' % cpv for cpv in cpvs],
 				env = {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)})
 
+	def call_emerge(self, *args, **kwargs):
+		p = self.spawn_emerge(*args, **kwargs)
+		return p.wait()
+
 	def merge(self, cpvs):
 		ret = self.call_emerge(cpvs)
 		return ret == 0
@@ -48,14 +52,8 @@ class PortagePM(PackageManager):
 		ret = self.call_emerge(cpvs, ['--unmerge'])
 		return ret == 0
 
-	def spawn_emerge(self, cpvs, opts = []):
-		p = subprocess.Popen([self.emerge_path] + opts + self.pm_options
-				+ ['=%s' % cpv for cpv in cpvs],
-				env = {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)})
-		return p.pid
-
 	def merge_async(self, cpvs):
-		return self.spawn_emerge(cpvs)
+		return self.spawn_emerge(cpvs).pid
 
 	_vardb = None
 	@property



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-05-31 21:06 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-05-31 21:06 UTC (permalink / raw
  To: gentoo-commits

commit:     e921b30273c374cdbb44cf053ff22b32dfaa6458
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 31 20:54:00 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 31 20:54:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=e921b302

Add --oneshot to Portage options.

---
 PMSTestSuite/pm/portagepm.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index e1ad442..da50bc2 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -14,7 +14,7 @@ class PortagePM(PackageManager):
 	emerge_path = '/usr/bin/emerge'
 	repoman_path = '/usr/bin/repoman'
 
-	common_emerge_opts = ['--ask', 'n', '--keep-going']
+	common_emerge_opts = ['--ask', 'n', '--keep-going', '--oneshot']
 
 	repo_paths = []
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-06  7:36 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-06  7:36 UTC (permalink / raw
  To: gentoo-commits

commit:     25666338888be996c8ca496dc4fd8be11f91069f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  6 07:36:31 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jun  6 07:36:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=25666338

Check whether portage has userpriv actually enabled.

---
 PMSTestSuite/pm/portagepm.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index 8a980bb..b831731 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -77,6 +77,8 @@ class PortagePM(PackageManager):
 		return installed_cpvs
 
 	def get_userpriv_group(self):
-		# XXX: check for FEATURES=userpriv
-		from portage.data import userpriv_groups
-		return userpriv_groups[0]
+		if 'userpriv' in self.vardb.settings.features:
+			from portage.data import userpriv_groups
+			return userpriv_groups[0]
+		else:
+			return None



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-07 14:54 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-07 14:54 UTC (permalink / raw
  To: gentoo-commits

commit:     a1b14f1a741d3e83f16a68db4f19fc45be1abab6
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  7 14:45:58 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun  7 14:45:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=a1b14f1a

Add some initial code for pkgcore support.

---
 PMSTestSuite/pm/__init__.py  |    3 +-
 PMSTestSuite/pm/pkgcorepm.py |   59 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+), 1 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 54204da..7731d74 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -104,6 +104,7 @@ def get_package_managers():
 	""" Return the list of supported Package Managers. """
 
 	from PMSTestSuite.pm.portagepm import PortagePM
+	from PMSTestSuite.pm.pkgcorepm import PkgCorePM
 
 	class PMWrapper(object):
 		""" A wrapper class which stringifies into a name of particular PM. """
@@ -129,4 +130,4 @@ def get_package_managers():
 						% self._pmclass.pkg)
 			return self._pmclass()
 
-	return [PMWrapper(x) for x in (PortagePM,)]
+	return [PMWrapper(x) for x in (PortagePM, PkgCorePM)]

diff --git a/PMSTestSuite/pm/pkgcorepm.py b/PMSTestSuite/pm/pkgcorepm.py
new file mode 100644
index 0000000..4e5a525
--- /dev/null
+++ b/PMSTestSuite/pm/pkgcorepm.py
@@ -0,0 +1,59 @@
+#	vim:fileencoding=utf-8
+# (c) 2011 Michał Górny <mgorny@gentoo.org>
+# Released under the terms of the 2-clause BSD license.
+
+import os, os.path, subprocess
+
+from PMSTestSuite.pm.portagepm import PortagePM
+
+class PkgCorePM(PortagePM):
+	"""
+	A class implementing the interfaces to the pkgcore PM.
+	
+	Right now it subclasses PortagePM because it needs repoman to do
+	the Manifests.
+	"""
+	name = 'pkgcore'
+	pkg = 'sys-apps/pkgcore'
+
+	pmerge_path = '/usr/bin/pmerge'
+
+	common_pmerge_opts = ['--oneshot']
+
+	@classmethod
+	def is_available(cls):
+		try:
+			import pkgcore
+		except ImportError:
+			return False
+
+		ret = True
+		for prog in (cls.pmerge_path, cls.repoman_path):
+			ret &= os.access(prog, os.X_OK)
+		return ret
+
+	def spawn_pmerge(self, cpvs, opts = []):
+		return subprocess.Popen([self.pmerge_path]
+				+ self.common_pmerge_opts + opts + self.pm_options
+				+ ['=%s' % cpv for cpv in cpvs])
+
+	def call_pmerge(self, *args, **kwargs):
+		p = self.spawn_pmerge(*args, **kwargs)
+		return p.wait()
+
+	def merge(self, cpvs):
+		ret = self.call_pmerge(cpvs)
+		return ret == 0
+
+	def unmerge(self, cpvs):
+		ret = self.call_pmerge(cpvs, ['--unmerge'])
+		return ret == 0
+
+	def merge_async(self, cpvs):
+		return self.spawn_pmerge(cpvs).pid
+
+	def append_repository(self, repo):
+		raise NotImplementedError('PkgCorePM does not support adding repositories yet.')
+
+	# XXX: vardb and stuff
+	# portage's get_userpriv_group() required by repoman



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-07 15:20 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-07 15:20 UTC (permalink / raw
  To: gentoo-commits

commit:     533f19177aec9eb4782ed9f0c2864643262f4c54
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  7 15:13:29 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun  7 15:13:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=533f1917

Portage: support grabbing portdb as well.

---
 PMSTestSuite/pm/portagepm.py |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index b831731..23f2cf8 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -59,18 +59,28 @@ class PortagePM(PackageManager):
 		return self.spawn_emerge(cpvs).pid
 
 	_vardb = None
+	_portdb = None
+	def _create_trees(self):
+		from portage import create_trees
+		trees = create_trees(
+				config_root = os.environ.get('PORTAGE_CONFIGROOT'),
+				target_root = os.environ.get('ROOT'))
+		tree = trees[max(trees)]
+		self._vardb = tree['vartree'].dbapi
+		self._portdb = tree['porttree'].dbapi
+
 	@property
 	def vardb(self):
 		if not self._vardb:
-			from portage import create_trees
-			trees = create_trees(
-					config_root = os.environ.get('PORTAGE_CONFIGROOT'),
-					target_root = os.environ.get('ROOT'))
-			tree = trees[max(trees)]
-			self._vardb = tree['vartree'].dbapi
-
+			self._create_trees()
 		return self._vardb
 
+	@property
+	def portdb(self):
+		if not self._portdb:
+			self._create_trees()
+		return self._portdb
+
 	def lookup_vardb(self, cpvs):
 		installed_cpvs = set(self.vardb.cpv_all())
 		installed_cpvs &= set(cpvs)



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-07 17:16 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-07 17:16 UTC (permalink / raw
  To: gentoo-commits

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

Portage: use portdb to get settings instead of vardb.

This will simplify implementation of pkgcore support.

---
 PMSTestSuite/pm/portagepm.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index b3f437d..bfc7fbf 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -94,7 +94,7 @@ class PortagePM(PackageManager):
 		return installed_cpvs
 
 	def get_userpriv_group(self):
-		if 'userpriv' in self.vardb.settings.features:
+		if 'userpriv' in self.portdb.settings.features:
 			from portage.data import userpriv_groups
 			return userpriv_groups[0]
 		else:



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-07 17:16 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-07 17:16 UTC (permalink / raw
  To: gentoo-commits

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



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-14 12:35 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-14 12:35 UTC (permalink / raw
  To: gentoo-commits

commit:     3f0b3321fb69d8b3159a7ab991882943a51c8324
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 14 12:25:39 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 14 12:25:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=3f0b3321

Fix overriding the whole process env for portage.

---
 PMSTestSuite/pm/portagepm.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index 19f3f8a..66310f4 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -8,7 +8,7 @@
 <PMSTestSuite.repository.EbuildRepository object at ...>
 """
 
-import os, os.path, subprocess
+import copy, os, os.path, subprocess
 
 from PMSTestSuite.repository import EbuildRepository
 from PMSTestSuite.pm import PackageManager
@@ -46,10 +46,16 @@ class PortagePM(PackageManager):
 		os.chdir(startdir)
 
 	def spawn_emerge(self, cpvs, opts = []):
+		kwargs = {}
+		if self.repo_paths:
+			env = copy.copy(os.environ)
+			env['PORTDIR_OVERLAY'] = ' '.join(self.repo_paths)
+			kwargs['env'] = env
+
 		return subprocess.Popen([self.emerge_path]
 				+ self.common_emerge_opts + opts + self.pm_options
 				+ ['=%s' % cpv for cpv in cpvs],
-				env = {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)})
+				**kwargs)
 
 	def call_emerge(self, *args, **kwargs):
 		p = self.spawn_emerge(*args, **kwargs)



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-16 19:49 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-16 19:49 UTC (permalink / raw
  To: gentoo-commits

commit:     3294050e25c59040554d7152f1c7c6a930585867
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 16 19:13:17 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun 16 19:13:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=3294050e

Support passing a single CPV to PackageManager.merge()/unmerge().

---
 PMSTestSuite/pm/__init__.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 02e9016..1f88ea6 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -96,19 +96,25 @@ class PackageManager(object):
 		self._current_op = None
 		self.pkg_queue = []
 
+	def _append_cpvs(self, cpvs):
+		if isinstance(cpvs, basestring):
+			self.pkg_queue.append(cpvs)
+		else:
+			self.pkg_queue.extend(cpvs)
+
 	def merge(self, cpvs):
 		"""
 		Queue merging <cpvs> (either a list or a string).
 		"""
 		self.op = PackageManagerOps.merge
-		self.pkg_queue.extend(cpvs)
+		self._append_cpvs(cpvs)
 
 	def unmerge(self, cpvs):
 		"""
 		Queue unmerging <cpvs> (either a list or a string).
 		"""
 		self.op = PackageManagerOps.unmerge
-		self.pkg_queue.extend(cpvs)
+		self._append_cpvs(cpvs)
 
 	def _spawn_merge(self, pkgs):
 		"""



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-16 19:49 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-16 19:49 UTC (permalink / raw
  To: gentoo-commits

commit:     611b93540ad69f6172bc01cea114865abd425b60
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 16 19:24:29 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun 16 19:24:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=611b9354

Introduce pending action check for PM.

---
 PMSTestSuite/pm/__init__.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 1f88ea6..65e6d97 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -139,12 +139,26 @@ class PackageManager(object):
 		del self.op
 		callback()
 
+	@property
+	def has_pending_actions(self):
+		"""
+		Return whether PM has any pending actions (i.e. packages
+		to merge/unmerge).
+		"""
+		return bool(self.pkg_queue)
+
 	def commit(self, callback):
 		"""
 		Perform queued operations in the background (using glib), starting PM
 		multiple times if necessary. Call <callback> when done.
+
+		If PM has no pending actions, the callback will be called immediately.
 		"""
 
+		if not self.has_pending_actions:
+			callback()
+			return
+
 		if self.op == PackageManagerOps.merge:
 			if self.package_limit:
 				pkgs = self.pkg_queue[:self.package_limit]



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-20 19:20 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-20 19:20 UTC (permalink / raw
  To: gentoo-commits

commit:     fa71df60e5ee36cd09bd2329510133ef7bf5c52e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 20 19:20:25 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jun 20 19:20:25 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=fa71df60

Remove old async_ method from abstract PackageManager.

---
 PMSTestSuite/pm/__init__.py |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 65e6d97..22b4d3d 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -185,16 +185,6 @@ class PackageManager(object):
 		"""
 		raise NotImplementedError('Please override the lookup_vardb() method.')
 
-	# async methods which are supposed to run in background and return pids
-	def merge_async(self, cpvs):
-		"""
-		Run PM asynchronically to merge <cpvs>.
-
-		Returns the PID of spawned process, or raises an exception if spawning
-		one fails.
-		"""
-		raise NotImplementedError('Please override the merge_async() method.')
-
 	def get_userpriv_group(self):
 		"""
 		Get the group name which needs to own ebuild files for userpriv to work.



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 15:26 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 15:26 UTC (permalink / raw
  To: gentoo-commits

commit:     15bdcdd91a6a8a9cf0f94494c0e57ec0b3b7357f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 15:26:46 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 15:26:46 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=15bdcdd9

Remove stupid +x checks and don't rely on abs paths to PMs.

---
 PMSTestSuite/pm/pkgcorepm.py |   12 +++---------
 PMSTestSuite/pm/portagepm.py |   15 ++++-----------
 2 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/PMSTestSuite/pm/pkgcorepm.py b/PMSTestSuite/pm/pkgcorepm.py
index ba1b1a0..3497823 100644
--- a/PMSTestSuite/pm/pkgcorepm.py
+++ b/PMSTestSuite/pm/pkgcorepm.py
@@ -8,7 +8,7 @@
 <PMSTestSuite.repository.EbuildRepository object at ...>
 """
 
-import os, os.path, subprocess
+import subprocess
 
 from PMSTestSuite.repository import EbuildRepository
 from PMSTestSuite.pm.portagepm import PortagePM
@@ -24,8 +24,6 @@ class PkgCorePM(PortagePM):
 	pkg = 'sys-apps/pkgcore'
 	failure_nonfatal = False
 
-	pmerge_path = '/usr/bin/pmerge'
-
 	common_pmerge_opts = ['--oneshot']
 
 	@classmethod
@@ -34,11 +32,7 @@ class PkgCorePM(PortagePM):
 			import pkgcore
 		except ImportError:
 			return False
-
-		ret = True
-		for prog in (cls.pmerge_path, cls.repoman_path):
-			ret &= os.access(prog, os.X_OK)
-		return ret
+		return True
 
 	@property
 	def package_limit(self):
@@ -49,7 +43,7 @@ class PkgCorePM(PortagePM):
 		pass
 
 	def spawn_pmerge(self, cpvs, opts = []):
-		return subprocess.Popen([self.pmerge_path]
+		return subprocess.Popen(['pmerge']
 				+ self.common_pmerge_opts + opts + self.pm_options
 				+ ['=%s' % cpv for cpv in cpvs])
 

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index 7d6c6a5..b681ce9 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -8,7 +8,7 @@
 <PMSTestSuite.repository.EbuildRepository object at ...>
 """
 
-import copy, os, os.path, subprocess
+import copy, os, subprocess
 
 from PMSTestSuite.repository import EbuildRepository
 from PMSTestSuite.pm import PackageManager
@@ -19,9 +19,6 @@ class PortagePM(PackageManager):
 	pkg = 'sys-apps/portage'
 	failure_nonfatal = True
 
-	emerge_path = '/usr/bin/emerge'
-	repoman_path = '/usr/bin/repoman'
-
 	common_emerge_opts = ['--ask', 'n', '--keep-going', '--oneshot']
 
 	repo_paths = []
@@ -32,17 +29,13 @@ class PortagePM(PackageManager):
 			import portage
 		except ImportError:
 			return False
-
-		ret = True
-		for prog in (cls.emerge_path, cls.repoman_path):
-			ret &= os.access(prog, os.X_OK)
-		return ret
+		return True
 
 	def remanifest(self, paths):
 		startdir = os.getcwd()
 		for path in paths:
 			os.chdir(path)
-			subprocess.check_call([self.repoman_path, 'manifest'])
+			subprocess.check_call(['repoman', 'manifest'])
 		os.chdir(startdir)
 
 	def spawn_emerge(self, cpvs, opts = []):
@@ -52,7 +45,7 @@ class PortagePM(PackageManager):
 			env['PORTDIR_OVERLAY'] = ' '.join(self.repo_paths)
 			kwargs['env'] = env
 
-		return subprocess.Popen([self.emerge_path]
+		return subprocess.Popen(['emerge']
 				+ self.common_emerge_opts + opts + self.pm_options
 				+ ['=%s' % cpv for cpv in cpvs],
 				**kwargs)



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 15:26 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 15:26 UTC (permalink / raw
  To: gentoo-commits

commit:     0a452f9d9419fe82d5aee84cd27fd6dc488e4538
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 15:22:14 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 15:22:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=0a452f9d

Add a minimal Paludis support.

---
 PMSTestSuite/pm/__init__.py  |    3 +-
 PMSTestSuite/pm/paludispm.py |   48 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index c804558..a4d14b7 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -208,6 +208,7 @@ def get_package_managers():
 
 	from PMSTestSuite.pm.portagepm import PortagePM
 	from PMSTestSuite.pm.pkgcorepm import PkgCorePM
+	from PMSTestSuite.pm.paludispm import PaludisPM
 
 	class PMWrapper(object):
 		""" A wrapper class which stringifies into a name of particular PM. """
@@ -233,4 +234,4 @@ def get_package_managers():
 						% self._pmclass.pkg)
 			return self._pmclass()
 
-	return [PMWrapper(x) for x in (PortagePM, PkgCorePM)]
+	return [PMWrapper(x) for x in (PortagePM, PkgCorePM, PaludisPM)]

diff --git a/PMSTestSuite/pm/paludispm.py b/PMSTestSuite/pm/paludispm.py
new file mode 100644
index 0000000..01fdb96
--- /dev/null
+++ b/PMSTestSuite/pm/paludispm.py
@@ -0,0 +1,48 @@
+#	vim:fileencoding=utf-8
+# (c) 2011 Michał Górny <mgorny@gentoo.org>
+# Released under the terms of the 2-clause BSD license.
+
+"""
+>>> pm = PaludisPM()
+>>> pm.get_repository('gentoo') # doctest: +ELLIPSIS
+<PMSTestSuite.repository.EbuildRepository object at ...>
+"""
+
+import os, os.path, subprocess
+
+from PMSTestSuite.repository import EbuildRepository
+from PMSTestSuite.pm.portagepm import PortagePM
+
+class PaludisPM(PortagePM):
+	"""
+	A class implementing the interfaces to the Paludis PM.
+	
+	Requires Paludis with USE=python.
+	"""
+	name = 'paludis'
+	pkg = 'sys-apps/paludis[python]'
+
+	cave_path = '/usr/bin/cave'
+	common_cave_opts = ['--lazy', '--preserve-world', '--execute']
+
+	@classmethod
+	def is_available(cls):
+		try:
+			import paludis
+		except ImportError:
+			return False
+		return True
+
+	def _spawn_cave(self, cpvs, action, opts = []):
+		return subprocess.Popen(['cave', action]
+				+ self.common_cave_opts + opts + self.pm_options
+				+ ['=%s' % cpv for cpv in cpvs])
+
+	def _spawn_merge(self, cpvs):
+		return self._spawn_cave(cpvs, 'resolve', ['--continue-on-failure', 'if-satisfied'])
+
+	def _spawn_unmerge(self, cpvs):
+		return self._spawn_cave(cpvs, 'uninstall')
+
+	def append_repository(self, repo):
+		raise NotImplementedError('PaludisPM does not support adding repositories yet.')



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 17:54 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 17:54 UTC (permalink / raw
  To: gentoo-commits

commit:     97bed400de26be25caa177a922c914e8339cbcb7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 16:29:09 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 16:29:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=97bed400

Decrease paludis verbosity.

---
 PMSTestSuite/pm/paludispm.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/PMSTestSuite/pm/paludispm.py b/PMSTestSuite/pm/paludispm.py
index 01fdb96..4fec9d7 100644
--- a/PMSTestSuite/pm/paludispm.py
+++ b/PMSTestSuite/pm/paludispm.py
@@ -34,7 +34,7 @@ class PaludisPM(PortagePM):
 		return True
 
 	def _spawn_cave(self, cpvs, action, opts = []):
-		return subprocess.Popen(['cave', action]
+		return subprocess.Popen(['cave', '--log-level', 'warning', action]
 				+ self.common_cave_opts + opts + self.pm_options
 				+ ['=%s' % cpv for cpv in cpvs])
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 17:54 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 17:54 UTC (permalink / raw
  To: gentoo-commits

commit:     be7052df64c69d09ce63518f231a2e4352bd3225
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 16:48:49 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 16:48:49 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=be7052df

pkgcore: support running without Manifests.

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

diff --git a/PMSTestSuite/pm/pkgcorepm.py b/PMSTestSuite/pm/pkgcorepm.py
index 3497823..0e32814 100644
--- a/PMSTestSuite/pm/pkgcorepm.py
+++ b/PMSTestSuite/pm/pkgcorepm.py
@@ -78,6 +78,9 @@ class PkgCorePM(PortagePM):
 	def get_repository(self, name):
 		for r in self.config.repo.values():
 			if hasattr(r, 'repo_id') and r.repo_id == name:
+				# add config override for it as well
+				self.common_pmerge_opts = self.common_pmerge_opts \
+						+ ['--add-config', r.location, 'allow_missing_manifests', 'True']
 				return EbuildRepository(r.location)
 		else:
 			raise KeyError('Repository %s not found.' % name)



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 17:54 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 17:54 UTC (permalink / raw
  To: gentoo-commits

commit:     4733db7f432eb0f1c0c4b84ad16f488380aaa461
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 16:52:22 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 16:52:22 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=4733db7f

pkgcore: don't do manifests any more.

This removes the portage/repoman dependency, and userpriv needs.

---
 PMSTestSuite/pm/pkgcorepm.py |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/PMSTestSuite/pm/pkgcorepm.py b/PMSTestSuite/pm/pkgcorepm.py
index 0e32814..1e99bac 100644
--- a/PMSTestSuite/pm/pkgcorepm.py
+++ b/PMSTestSuite/pm/pkgcorepm.py
@@ -11,14 +11,11 @@
 import subprocess
 
 from PMSTestSuite.repository import EbuildRepository
-from PMSTestSuite.pm.portagepm import PortagePM
+from PMSTestSuite.pm import PackageManager
 
-class PkgCorePM(PortagePM):
+class PkgCorePM(PackageManager):
 	"""
 	A class implementing the interfaces to the pkgcore PM.
-	
-	Right now it subclasses PortagePM because it needs repoman to do
-	the Manifests.
 	"""
 	name = 'pkgcore'
 	pkg = 'sys-apps/pkgcore'
@@ -90,4 +87,9 @@ class PkgCorePM(PortagePM):
 		installed_cpvs &= set(cpvs)
 		return installed_cpvs
 
-	# portage's get_userpriv_group() required by repoman
+	# pkgcore can't do Manifests
+	def remanifest(self, *args):
+		pass
+
+	def get_userpriv_group(self):
+		return None



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 17:54 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 17:54 UTC (permalink / raw
  To: gentoo-commits

commit:     01f2d5d64b2e585f5277436e81cc7be13cf5ff56
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 17:11:21 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 17:11:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=01f2d5d6

portage: support ignoring Manifests (non-strict mode).

Don't build binpkgs too.

---
 PMSTestSuite/pm/portagepm.py |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index b681ce9..dc59cb2 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -39,16 +39,15 @@ class PortagePM(PackageManager):
 		os.chdir(startdir)
 
 	def spawn_emerge(self, cpvs, opts = []):
-		kwargs = {}
+		env = copy.copy(os.environ)
+		env['FEATURES'] = '-buildpkg -strict'
 		if self.repo_paths:
-			env = copy.copy(os.environ)
 			env['PORTDIR_OVERLAY'] = ' '.join(self.repo_paths)
-			kwargs['env'] = env
 
 		return subprocess.Popen(['emerge']
 				+ self.common_emerge_opts + opts + self.pm_options
 				+ ['=%s' % cpv for cpv in cpvs],
-				**kwargs)
+				env = env)
 
 	def _spawn_merge(self, cpvs):
 		return self.spawn_emerge(cpvs)



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 17:58 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 17:58 UTC (permalink / raw
  To: gentoo-commits

commit:     cc3e0412c59dd7b1c91bce7414c432ba2f157e24
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 17:58:42 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 17:58:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=cc3e0412

Remove get_userpriv_group() function.

We no longer care about that. We just make the repo world-readable.

---
 PMSTestSuite/pm/__init__.py  |   10 ----------
 PMSTestSuite/pm/pkgcorepm.py |    3 ---
 PMSTestSuite/pm/portagepm.py |    7 -------
 3 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index a4d14b7..7fe7698 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -193,16 +193,6 @@ class PackageManager(object):
 		"""
 		pass
 
-	@abstractmethod
-	def get_userpriv_group(self):
-		"""
-		Get the group name which needs to own ebuild files for userpriv to work.
-		
-		If userpriv is not in effect, returns None (no need for ownership
-		changes).
-		"""
-		pass
-
 def get_package_managers():
 	""" Return the list of supported Package Managers. """
 

diff --git a/PMSTestSuite/pm/pkgcorepm.py b/PMSTestSuite/pm/pkgcorepm.py
index 1e99bac..64aaffd 100644
--- a/PMSTestSuite/pm/pkgcorepm.py
+++ b/PMSTestSuite/pm/pkgcorepm.py
@@ -90,6 +90,3 @@ class PkgCorePM(PackageManager):
 	# pkgcore can't do Manifests
 	def remanifest(self, *args):
 		pass
-
-	def get_userpriv_group(self):
-		return None

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index dc59cb2..0846b63 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -83,13 +83,6 @@ class PortagePM(PackageManager):
 		installed_cpvs &= set(cpvs)
 		return installed_cpvs
 
-	def get_userpriv_group(self):
-		if 'userpriv' in self.portdb.settings.features:
-			from portage.data import userpriv_groups
-			return userpriv_groups[0]
-		else:
-			return None
-
 	def get_repository(self, name):
 		r = self.portdb.getRepositoryPath(name)
 		if not r:



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 20:58 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 20:58 UTC (permalink / raw
  To: gentoo-commits

commit:     b455311d85e4062d5af7396f6211d66b60726017
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 20:29:33 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 20:29:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=b455311d

paludis: get repository path using cave.

---
 PMSTestSuite/pm/paludispm.py |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/PMSTestSuite/pm/paludispm.py b/PMSTestSuite/pm/paludispm.py
index 619e77b..7e71f15 100644
--- a/PMSTestSuite/pm/paludispm.py
+++ b/PMSTestSuite/pm/paludispm.py
@@ -11,6 +11,7 @@
 import os, os.path, subprocess
 
 from PMSTestSuite.repository import EbuildRepository
+from PMSTestSuite.pm import PackageManager
 from PMSTestSuite.pm.portagepm import PortagePM
 
 class PaludisPM(PortagePM):
@@ -25,7 +26,7 @@ class PaludisPM(PortagePM):
 	cave_path = '/usr/bin/cave'
 	common_cave_opts = ['--lazy', '--preserve-world', '--execute']
 
-	class VDB(PortagePM.VDB):
+	class VDB(PackageManager.VDB):
 		def __contains__(self, cpv):
 			p = subprocess.Popen(['cave', '--log-level', 'silent',
 					'has-version', '=%s' % cpv])
@@ -52,3 +53,13 @@ class PaludisPM(PortagePM):
 
 	def append_repository(self, repo):
 		raise NotImplementedError('PaludisPM does not support adding repositories yet.')
+
+	def get_repository(self, name):
+		s = subprocess.Popen(['cave', '--log-level', 'silent',
+				'print-repository-metadata', name,
+				'--raw-name', 'location',
+				'--format', '%v'], stdout=subprocess.PIPE)
+		r = s.communicate()[0]
+		if not r or s.returncode != 0:
+			raise KeyError('Repository %s not found.' % name)
+		return EbuildRepository(r)



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 20:58 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 20:58 UTC (permalink / raw
  To: gentoo-commits

commit:     2e34cb44425163dc3e0724652671f9e1c98cebe9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 20:13:22 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 20:13:22 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=2e34cb44

paludis: support vdb lookups using cave.

---
 PMSTestSuite/pm/paludispm.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/PMSTestSuite/pm/paludispm.py b/PMSTestSuite/pm/paludispm.py
index 4fec9d7..619e77b 100644
--- a/PMSTestSuite/pm/paludispm.py
+++ b/PMSTestSuite/pm/paludispm.py
@@ -25,6 +25,12 @@ class PaludisPM(PortagePM):
 	cave_path = '/usr/bin/cave'
 	common_cave_opts = ['--lazy', '--preserve-world', '--execute']
 
+	class VDB(PortagePM.VDB):
+		def __contains__(self, cpv):
+			p = subprocess.Popen(['cave', '--log-level', 'silent',
+					'has-version', '=%s' % cpv])
+			return p.wait() == 0
+
 	@classmethod
 	def is_available(cls):
 		try:



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 20:58 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 20:58 UTC (permalink / raw
  To: gentoo-commits

commit:     e9255155ee573434f8419de6121237daf641312e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 20:54:14 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 20:54:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=e9255155

paludis: use cave to generate Manifests.

---
 PMSTestSuite/pm/paludispm.py |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/PMSTestSuite/pm/paludispm.py b/PMSTestSuite/pm/paludispm.py
index 7e71f15..834a150 100644
--- a/PMSTestSuite/pm/paludispm.py
+++ b/PMSTestSuite/pm/paludispm.py
@@ -12,9 +12,8 @@ import os, os.path, subprocess
 
 from PMSTestSuite.repository import EbuildRepository
 from PMSTestSuite.pm import PackageManager
-from PMSTestSuite.pm.portagepm import PortagePM
 
-class PaludisPM(PortagePM):
+class PaludisPM(PackageManager):
 	"""
 	A class implementing the interfaces to the Paludis PM.
 	
@@ -54,6 +53,7 @@ class PaludisPM(PortagePM):
 	def append_repository(self, repo):
 		raise NotImplementedError('PaludisPM does not support adding repositories yet.')
 
+	_repo_mappings = {}
 	def get_repository(self, name):
 		s = subprocess.Popen(['cave', '--log-level', 'silent',
 				'print-repository-metadata', name,
@@ -62,4 +62,14 @@ class PaludisPM(PortagePM):
 		r = s.communicate()[0]
 		if not r or s.returncode != 0:
 			raise KeyError('Repository %s not found.' % name)
+		self._repo_mappings[r] = name
 		return EbuildRepository(r)
+
+	def remanifest(self, paths):
+		for path in paths:
+			tmp, pn = os.path.split(path)
+			repo_path, cat = os.path.split(tmp)
+			repo_name = self._repo_mappings[repo_path]
+
+			subprocess.check_call(['cave', '--log-level', 'silent',
+				'digest', '%s/%s' % (cat, pn), repo_name])



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 20:58 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 20:58 UTC (permalink / raw
  To: gentoo-commits

commit:     37601edef85f1c32c6641089bd74dea886e86306
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 20:58:27 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 20:58:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=37601ede

paludis: don't require python bindings.

---
 PMSTestSuite/pm/paludispm.py |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/PMSTestSuite/pm/paludispm.py b/PMSTestSuite/pm/paludispm.py
index 834a150..3b9effa 100644
--- a/PMSTestSuite/pm/paludispm.py
+++ b/PMSTestSuite/pm/paludispm.py
@@ -20,7 +20,7 @@ class PaludisPM(PackageManager):
 	Requires Paludis with USE=python.
 	"""
 	name = 'paludis'
-	pkg = 'sys-apps/paludis[python]'
+	pkg = 'sys-apps/paludis'
 
 	cave_path = '/usr/bin/cave'
 	common_cave_opts = ['--lazy', '--preserve-world', '--execute']
@@ -33,11 +33,10 @@ class PaludisPM(PackageManager):
 
 	@classmethod
 	def is_available(cls):
-		try:
-			import paludis
-		except ImportError:
-			return False
-		return True
+		p = subprocess.Popen(['cave', '--version'],
+				stdout = subprocess.PIPE, stderr = subprocess.PIPE)
+		p.communicate()
+		return p.wait() == 0
 
 	def _spawn_cave(self, cpvs, action, opts = []):
 		return subprocess.Popen(['cave', '--log-level', 'warning', action]
@@ -60,7 +59,7 @@ class PaludisPM(PackageManager):
 				'--raw-name', 'location',
 				'--format', '%v'], stdout=subprocess.PIPE)
 		r = s.communicate()[0]
-		if not r or s.returncode != 0:
+		if not r or s.wait() != 0:
 			raise KeyError('Repository %s not found.' % name)
 		self._repo_mappings[r] = name
 		return EbuildRepository(r)



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 20:58 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 20:58 UTC (permalink / raw
  To: gentoo-commits

commit:     e8ce0f0dc51f8d83f268335b0552ed4d10409d13
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 21 20:27:27 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 21 20:27:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=e8ce0f0d

Don't pass PM instance to VDB, and don't require __init__.

---
 PMSTestSuite/pm/__init__.py  |   10 +---------
 PMSTestSuite/pm/portagepm.py |    2 +-
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 7c3ef4d..b6066de 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -38,14 +38,6 @@ class PackageManager(object):
 		__metaclass__ = ABCMeta
 
 		@abstractmethod
-		def __init__(self, pm):
-			"""
-			Instantiate the VDB interface. Passed parent PackageManager
-			instance.
-			"""
-			pass
-
-		@abstractmethod
 		def __contains__(self, pkg):
 			"""
 			Check whether a particular package (CPV) was merged (and thus exists
@@ -54,7 +46,7 @@ class PackageManager(object):
 			pass
 
 	def __init__(self):
-		self.vdb = self.VDB(self)
+		self.vdb = self.VDB()
 
 	@abstractproperty
 	def name(self):

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index fee2c07..2765def 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -27,7 +27,7 @@ class PortagePM(PackageManager):
 		def __contains__(self, cpv):
 			return bool(self._vardb.cpv_exists(cpv))
 
-		def __init__(self, pm):
+		def __init__(self):
 			from portage import create_trees
 			trees = create_trees(
 					config_root = os.environ.get('PORTAGE_CONFIGROOT'),



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-21 21:25 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-21 21:25 UTC (permalink / raw
  To: gentoo-commits

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

Fix initializing PkgCorePM.VDB.

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

diff --git a/PMSTestSuite/pm/pkgcorepm.py b/PMSTestSuite/pm/pkgcorepm.py
index 9d11046..eece213 100644
--- a/PMSTestSuite/pm/pkgcorepm.py
+++ b/PMSTestSuite/pm/pkgcorepm.py
@@ -37,7 +37,7 @@ class PkgCorePM(PackageManager):
 					return True
 			return False
 
-		def __init__(self, pm):
+		def __init__(self):
 			self._load_config()
 
 	@classmethod



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-23  9:51 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-23  9:51 UTC (permalink / raw
  To: gentoo-commits

commit:     c60522911a50d34cafaf0b87e7813aa103bdecb8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 23 09:51:35 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun 23 09:51:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=c6052291

Paludis: support grabbing metadata off vardb.

---
 PMSTestSuite/pm/paludispm.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/PMSTestSuite/pm/paludispm.py b/PMSTestSuite/pm/paludispm.py
index 3b9effa..58c93cc 100644
--- a/PMSTestSuite/pm/paludispm.py
+++ b/PMSTestSuite/pm/paludispm.py
@@ -26,6 +26,14 @@ class PaludisPM(PackageManager):
 	common_cave_opts = ['--lazy', '--preserve-world', '--execute']
 
 	class VDB(PackageManager.VDB):
+		class VDBPackage(PackageManager.VDB.VDBPackage):
+			def __getattr__(self, name):
+				p = subprocess.Popen(['cave', '--log-level', 'silent',
+						'print-id-metadata', '--raw-name', name,
+						'--format', '%v', '=%s::installed' % self._cpv],
+						stdout = subprocess.PIPE)
+				return p.communicate()[0]
+
 		def __contains__(self, cpv):
 			p = subprocess.Popen(['cave', '--log-level', 'silent',
 					'has-version', '=%s' % cpv])



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-23  9:51 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-23  9:51 UTC (permalink / raw
  To: gentoo-commits

commit:     4297bba31e092efd470562c9897420ac7b15b587
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 23 09:27:11 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun 23 09:27:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=4297bba3

portage: support metadata lookups in vardb.

---
 PMSTestSuite/pm/portagepm.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index 2765def..2ed2536 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -24,6 +24,10 @@ class PortagePM(PackageManager):
 	repo_paths = []
 
 	class VDB(PackageManager.VDB):
+		class VDBPackage(PackageManager.VDB.VDBPackage):
+			def __getattr__(self, name):
+				return self._vdb._vardb.aux_get(self._cpv, [name])[0]
+
 		def __contains__(self, cpv):
 			return bool(self._vardb.cpv_exists(cpv))
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-23  9:51 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-23  9:51 UTC (permalink / raw
  To: gentoo-commits

commit:     07463256dde88133c98b42eb619a9875323936bb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 23 09:26:53 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun 23 09:26:53 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=07463256

Introduce an abstract API for metadata lookups.

---
 PMSTestSuite/pm/__init__.py |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index b6066de..fa5adf0 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -37,6 +37,28 @@ class PackageManager(object):
 		"""
 		__metaclass__ = ABCMeta
 
+		class VDBPackage(object):
+			"""
+			A single package (ebuild) in VDB.
+
+			Private attrs:
+			- _cpv - requested CPV,
+			- _vdb - parent VDB instance.
+			"""
+			__metaclass__ = ABCMeta
+
+			@abstractmethod
+			def __getattr__(self, name):
+				"""
+				Get the metadata key for a package.
+				"""
+				pass
+
+			def __init__(self, vdb, cpv):
+				""" Instantiate the VDBPackage. """
+				self._vdb = vdb
+				self._cpv = cpv
+
 		@abstractmethod
 		def __contains__(self, pkg):
 			"""
@@ -45,6 +67,14 @@ class PackageManager(object):
 			"""
 			pass
 
+		def __getitem__(self, key):
+			"""
+			Get a package by CPV.
+			"""
+			if key not in self:
+				raise KeyError('Package not in VDB: %s' % key)
+			return self.VDBPackage(self, key)
+
 	def __init__(self):
 		self.vdb = self.VDB()
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
@ 2011-06-23  9:51 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-06-23  9:51 UTC (permalink / raw
  To: gentoo-commits

commit:     58264d1e8b875fc00796c2055e40209247ec2e43
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 23 09:41:40 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun 23 09:41:40 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=58264d1e

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 = ['--oneshot']
 
 	class VDB(PackageManager.VDB):
+		class VDBPackage(PackageManager.VDB.VDBPackage):
+			def __getattr__(self, name):
+				return self._pkg.data[name]
+
+			def __init__(self, pkg):
+				self._pkg = pkg
+
 		_config = None
 		_vardb = None
 		def _load_config(self):
@@ -37,6 +44,13 @@ class PkgCorePM(PackageManager):
 					return True
 			return False
 
+		def __getitem__(self, key):
+			for p in self._vardb:
+				if p.cpvstr == key:
+					return self.VDBPackage(p)
+			else:
+				raise KeyError('Package not in VDB: %s' % key)
+
 		def __init__(self):
 			self._load_config()
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/pm/
@ 2011-07-31 15:10 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-31 15:10 UTC (permalink / raw
  To: gentoo-commits

commit:     2a3810b78b20f11b4e2e2f6aa0a5f7142ac68525
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 31 15:11:05 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jul 31 15:11:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=2a3810b7

Fix/reintroduce disabling Manifest checks for pkgcore.

---
 pmstestsuite/pm/pkgcorepm.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/pmstestsuite/pm/pkgcorepm.py b/pmstestsuite/pm/pkgcorepm.py
index 16da52e..e0f840f 100644
--- a/pmstestsuite/pm/pkgcorepm.py
+++ b/pmstestsuite/pm/pkgcorepm.py
@@ -48,6 +48,12 @@ class PkgCorePM(_PkgCorePM, PackageManager):
 	def append_repository(self, repo):
 		raise NotImplementedError('PkgCorePM does not support adding repositories yet.')
 
+	def get_repository(self, repo):
+		r = PackageManager.get_repository(self, repo)
+		self.common_pmerge_opts.extend(['--add-config',
+			r.path, 'allow_missing_manifests', 'True'])
+		return r
+
 	# pkgcore can't do Manifests
 	def remanifest(self, *args):
 		pass



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/pm/
@ 2011-08-03 20:17 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-08-03 20:17 UTC (permalink / raw
  To: gentoo-commits

commit:     b59d05b79a64c2362327e8982e979335b5ee57ce
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  3 19:24:30 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Aug  3 19:24:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=b59d05b7

Whitespace.

---
 pmstestsuite/pm/__init__.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pmstestsuite/pm/__init__.py b/pmstestsuite/pm/__init__.py
index 3db7772..e268f7f 100644
--- a/pmstestsuite/pm/__init__.py
+++ b/pmstestsuite/pm/__init__.py
@@ -36,7 +36,7 @@ class PackageManager(ABCObject):
 	def name(self):
 		"""
 		Human-readable, short PM name (used in option values).
-		
+
 		@type: string
 		"""
 		pass
@@ -55,7 +55,7 @@ class PackageManager(ABCObject):
 	def remanifest(self, paths):
 		"""
 		Regenerate Manifests in paths.
-		
+
 		@param paths: directory names to regenerate manifests in
 		@type paths: iterable(string)
 		"""
@@ -148,7 +148,7 @@ class PackageManager(ABCObject):
 	def _spawn_unmerge(self, pkgs):
 		"""
 		Spawn PM to perform unmerge of packages.
-		
+
 		@param pkgs: packages to merge
 		@type pkgs: iterable(string)
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/pm/
@ 2011-08-03 20:17 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-08-03 20:17 UTC (permalink / raw
  To: gentoo-commits

commit:     e3206725c0f79c4e456227f1edbd7fd67a756b48
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  3 19:22:12 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Aug  3 19:22:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=e3206725

Force config reload after merges in all PMs.

---
 pmstestsuite/pm/__init__.py  |    2 ++
 pmstestsuite/pm/pkgcorepm.py |    5 -----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/pmstestsuite/pm/__init__.py b/pmstestsuite/pm/__init__.py
index 1e1d50e..3db7772 100644
--- a/pmstestsuite/pm/__init__.py
+++ b/pmstestsuite/pm/__init__.py
@@ -166,6 +166,8 @@ class PackageManager(ABCObject):
 				return
 
 		del self.op
+		# need to reload the config to see updated vardb
+		self.reload_config()
 		callback()
 
 	@property

diff --git a/pmstestsuite/pm/pkgcorepm.py b/pmstestsuite/pm/pkgcorepm.py
index e0f840f..875ecf6 100644
--- a/pmstestsuite/pm/pkgcorepm.py
+++ b/pmstestsuite/pm/pkgcorepm.py
@@ -40,11 +40,6 @@ class PkgCorePM(_PkgCorePM, PackageManager):
 	def _spawn_unmerge(self, cpvs):
 		return self.spawn_pmerge(cpvs, ['--unmerge'])
 
-	def commit(self, *args, **kwargs):
-		PackageManager.commit(self, *args, **kwargs)
-		# need to reload the config to update vdb
-		self.reload_config()
-
 	def append_repository(self, repo):
 		raise NotImplementedError('PkgCorePM does not support adding repositories yet.')
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/pm/
@ 2011-08-05 17:09 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-08-05 17:09 UTC (permalink / raw
  To: gentoo-commits

commit:     bbbd7a62321e919b0d3d5dc62075e0146fd8560c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  5 16:14:35 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Aug  5 16:14:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=bbbd7a62

Keep PM lists separate.

---
 pmstestsuite/pm/__init__.py  |    6 ++++--
 pmstestsuite/pm/paludispm.py |    4 ++++
 pmstestsuite/pm/pkgcorepm.py |    4 ++++
 pmstestsuite/pm/portagepm.py |    4 ++++
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/pmstestsuite/pm/__init__.py b/pmstestsuite/pm/__init__.py
index 4da1fba..4667fab 100644
--- a/pmstestsuite/pm/__init__.py
+++ b/pmstestsuite/pm/__init__.py
@@ -26,12 +26,14 @@ class PackageManager(ABCObject):
 	"""
 
 	pm_options = []
-	repo_paths = []
-	pkg_queue = []
 	package_limit = None
 
 	_current_op = None
 
+	def __init__(self):
+		self.repo_paths = []
+		self.pkg_queue = []
+
 	@abstractproperty
 	def name(self):
 		"""

diff --git a/pmstestsuite/pm/paludispm.py b/pmstestsuite/pm/paludispm.py
index df1a686..bb65a13 100644
--- a/pmstestsuite/pm/paludispm.py
+++ b/pmstestsuite/pm/paludispm.py
@@ -25,6 +25,10 @@ class PaludisPM(_PaludisPM, PackageManager):
 	common_cave_opts = ['--lazy', '--preserve-world', '--execute']
 	requires_manifests = True
 
+	def __init__(self, *args, **kwargs):
+		PackageManager.__init__(self)
+		_PaludisPM.__init__(self, *args, **kwargs)
+
 	def _spawn_cave(self, cpvs, action, opts = []):
 		return subprocess.Popen(['cave', '--log-level', 'warning', action]
 				+ self.common_cave_opts + opts + self.pm_options

diff --git a/pmstestsuite/pm/pkgcorepm.py b/pmstestsuite/pm/pkgcorepm.py
index b430b2d..f543ec9 100644
--- a/pmstestsuite/pm/pkgcorepm.py
+++ b/pmstestsuite/pm/pkgcorepm.py
@@ -22,6 +22,10 @@ class PkgCorePM(_PkgCorePM, PackageManager):
 	common_pmerge_opts = ['--oneshot']
 	requires_manifests = False
 
+	def __init__(self, *args, **kwargs):
+		PackageManager.__init__(self)
+		_PkgCorePM.__init__(self, *args, **kwargs)
+
 	@property
 	def package_limit(self):
 		return 1

diff --git a/pmstestsuite/pm/portagepm.py b/pmstestsuite/pm/portagepm.py
index b5479b8..d2139b0 100644
--- a/pmstestsuite/pm/portagepm.py
+++ b/pmstestsuite/pm/portagepm.py
@@ -22,6 +22,10 @@ class PortagePM(_PortagePM, PackageManager):
 
 	repo_paths = []
 
+	def __init__(self, *args, **kwargs):
+		PackageManager.__init__(self)
+		_PortagePM.__init__(self, *args, **kwargs)
+
 	def remanifest(self, paths):
 		startdir = os.getcwd()
 		for path in paths:



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/pm/
@ 2011-08-05 17:09 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-08-05 17:09 UTC (permalink / raw
  To: gentoo-commits

commit:     e471c2514859d9d630d831267b5f68f99d74c75c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  5 15:42:27 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Aug  5 15:42:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=e471c251

Store whether PM requires Manifests.

---
 pmstestsuite/pm/__init__.py  |    9 +++++++++
 pmstestsuite/pm/paludispm.py |    1 +
 pmstestsuite/pm/pkgcorepm.py |    3 ++-
 pmstestsuite/pm/portagepm.py |    1 +
 4 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/pmstestsuite/pm/__init__.py b/pmstestsuite/pm/__init__.py
index e268f7f..4da1fba 100644
--- a/pmstestsuite/pm/__init__.py
+++ b/pmstestsuite/pm/__init__.py
@@ -41,6 +41,15 @@ class PackageManager(ABCObject):
 		"""
 		pass
 
+	@abstractproperty
+	def requires_manifests(self):
+		"""
+		Whether the PM requires Manifests.
+
+		@type: bool
+		"""
+		pass
+
 	@classmethod
 	def is_available(cls):
 		"""

diff --git a/pmstestsuite/pm/paludispm.py b/pmstestsuite/pm/paludispm.py
index be7cc84..df1a686 100644
--- a/pmstestsuite/pm/paludispm.py
+++ b/pmstestsuite/pm/paludispm.py
@@ -23,6 +23,7 @@ class PaludisPM(_PaludisPM, PackageManager):
 
 	cave_path = '/usr/bin/cave'
 	common_cave_opts = ['--lazy', '--preserve-world', '--execute']
+	requires_manifests = True
 
 	def _spawn_cave(self, cpvs, action, opts = []):
 		return subprocess.Popen(['cave', '--log-level', 'warning', action]

diff --git a/pmstestsuite/pm/pkgcorepm.py b/pmstestsuite/pm/pkgcorepm.py
index 875ecf6..b430b2d 100644
--- a/pmstestsuite/pm/pkgcorepm.py
+++ b/pmstestsuite/pm/pkgcorepm.py
@@ -20,6 +20,7 @@ class PkgCorePM(_PkgCorePM, PackageManager):
 	name = 'pkgcore'
 
 	common_pmerge_opts = ['--oneshot']
+	requires_manifests = False
 
 	@property
 	def package_limit(self):
@@ -51,4 +52,4 @@ class PkgCorePM(_PkgCorePM, PackageManager):
 
 	# pkgcore can't do Manifests
 	def remanifest(self, *args):
-		pass
+		raise NotImplementedError()

diff --git a/pmstestsuite/pm/portagepm.py b/pmstestsuite/pm/portagepm.py
index a33f24e..b5479b8 100644
--- a/pmstestsuite/pm/portagepm.py
+++ b/pmstestsuite/pm/portagepm.py
@@ -18,6 +18,7 @@ class PortagePM(_PortagePM, PackageManager):
 	name = 'portage'
 
 	common_emerge_opts = ['--ask', 'n', '--keep-going', '--oneshot']
+	requires_manifests = False
 
 	repo_paths = []
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/pm/
@ 2011-08-05 19:54 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-08-05 19:54 UTC (permalink / raw
  To: gentoo-commits

commit:     ac4b52af268673f22177d177b86777154ecccec8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  5 17:27:40 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Aug  5 17:27:40 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=ac4b52af

Portage: quieter unmerge, always remove build dir.

---
 pmstestsuite/pm/portagepm.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pmstestsuite/pm/portagepm.py b/pmstestsuite/pm/portagepm.py
index d2139b0..30b62ca 100644
--- a/pmstestsuite/pm/portagepm.py
+++ b/pmstestsuite/pm/portagepm.py
@@ -17,7 +17,8 @@ class PortagePM(_PortagePM, PackageManager):
 	""" A class implementing the interfaces to the Portage PM. """
 	name = 'portage'
 
-	common_emerge_opts = ['--ask', 'n', '--keep-going', '--oneshot']
+	common_emerge_opts = ['--ask', 'n', '--keep-going', '--oneshot',
+			'--quiet-unmerge-warn', '--fail-clean', 'y']
 	requires_manifests = False
 
 	repo_paths = []



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/pm/
@ 2011-08-08 21:31 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-08-08 21:31 UTC (permalink / raw
  To: gentoo-commits

commit:     206ec57adac178bb304a577077d3bc1bbcce1142
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  8 21:32:39 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug  8 21:32:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=206ec57a

Portage: disable unmerge delays.

---
 pmstestsuite/pm/portagepm.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/pmstestsuite/pm/portagepm.py b/pmstestsuite/pm/portagepm.py
index 30b62ca..1c00749 100644
--- a/pmstestsuite/pm/portagepm.py
+++ b/pmstestsuite/pm/portagepm.py
@@ -37,6 +37,7 @@ class PortagePM(_PortagePM, PackageManager):
 	def spawn_emerge(self, cpvs, opts = []):
 		env = copy.copy(os.environ)
 		env['FEATURES'] = '-buildpkg -strict'
+		env['CLEAN_DELAY'] = '0'
 		if self.repo_paths:
 			env['PORTDIR_OVERLAY'] = ' '.join(self.repo_paths)
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2011-08-08 21:31 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-06  7:36 [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/ Michał Górny
  -- 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 17:16 Michał Górny
2011-06-07 15:20 Michał Górny
2011-06-07 14:54 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox