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

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

Support passing repo paths to PM.

---
 PMSTestSuite/pm/__init__.py |    8 ++++++++
 PMSTestSuite/pm/portage.py  |    7 +++++--
 PMSTestSuite/testrunner.py  |    1 +
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 08b7c25..8189f83 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -15,6 +15,8 @@ class PackageManager(object):
 	Base class for various package managers support.
 	"""
 
+	repo_paths = []
+
 	@property
 	def name(self):
 		""" Human-readable, short PM name (used in option values). """
@@ -42,6 +44,12 @@ class PackageManager(object):
 		""" Regenerate Manifests in given <paths> (should be iterable). """
 		raise NotImplementedError('Please override the remanifest() method.')
 
+	def append_repository(self, repo):
+		"""
+		Append the repository <repo> (EbuildRepository) to PM's list of repos.
+		"""
+		self.repo_paths.append(repo.path)
+
 	def merge(self, atoms):
 		"""
 		Run PM to merge <atoms>.

diff --git a/PMSTestSuite/pm/portage.py b/PMSTestSuite/pm/portage.py
index 8326856..8a7763f 100644
--- a/PMSTestSuite/pm/portage.py
+++ b/PMSTestSuite/pm/portage.py
@@ -2,7 +2,7 @@
 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-import os, subprocess
+import os, os.path, subprocess
 
 from PMSTestSuite.pm import PackageManager
 
@@ -14,6 +14,8 @@ class PortagePM(PackageManager):
 	emerge_path = '/usr/bin/emerge'
 	repoman_path = '/usr/bin/repoman'
 
+	repo_paths = []
+
 	@classmethod
 	def is_available(cls):
 		try:
@@ -32,5 +34,6 @@ class PortagePM(PackageManager):
 			subprocess.check_call([self.repoman_path, 'manifest'])
 
 	def merge(self, atoms):
-		ret = subprocess.call([self.emerge_path] + atoms)
+		ret = subprocess.call([self.emerge_path] + atoms,
+				env = {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)})
 		return ret == 0

diff --git a/PMSTestSuite/testrunner.py b/PMSTestSuite/testrunner.py
index d7ca5c5..c1d2597 100644
--- a/PMSTestSuite/testrunner.py
+++ b/PMSTestSuite/testrunner.py
@@ -7,6 +7,7 @@ class TestRunnerCLI(EbuildGenCLI):
 		if ret != 0:
 			return ret
 
+		self.pm.append_repository(self.repository)
 		atoms = ['=%s' % t.p for t in self.test_library]
 		print('-> Running PM...')
 		self.pm.merge(atoms)



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

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

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

Enumerate the atom list and call PM.

---
 PMSTestSuite/pm/__init__.py |   10 ++++++++++
 PMSTestSuite/testrunner.py  |    4 ++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 80e698b..08b7c25 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -42,6 +42,16 @@ class PackageManager(object):
 		""" Regenerate Manifests in given <paths> (should be iterable). """
 		raise NotImplementedError('Please override the remanifest() method.')
 
+	def merge(self, atoms):
+		"""
+		Run PM to merge <atoms>.
+
+		Returns True if PM run successfully, False otherwise. Please note that
+		this return code may not have anything to do with ebuilds actually
+		getting merged.
+		"""
+		raise NotImplementedError('Please override the merge() method.')
+
 def get_package_managers():
 	""" Return the list of supported Package Managers. """
 

diff --git a/PMSTestSuite/testrunner.py b/PMSTestSuite/testrunner.py
index b3948ee..d7ca5c5 100644
--- a/PMSTestSuite/testrunner.py
+++ b/PMSTestSuite/testrunner.py
@@ -7,4 +7,8 @@ class TestRunnerCLI(EbuildGenCLI):
 		if ret != 0:
 			return ret
 
+		atoms = ['=%s' % t.p for t in self.test_library]
+		print('-> Running PM...')
+		self.pm.merge(atoms)
+
 		return 0



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

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

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

Support specifying additional PM options.

---
 PMSTestSuite/cli.py         |    5 ++++-
 PMSTestSuite/pm/__init__.py |    1 +
 PMSTestSuite/pm/portage.py  |    4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/PMSTestSuite/cli.py b/PMSTestSuite/cli.py
index b5c8921..713b1a0 100644
--- a/PMSTestSuite/cli.py
+++ b/PMSTestSuite/cli.py
@@ -2,7 +2,7 @@
 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-import os.path
+import os.path, shlex
 
 from optparse import OptionParser
 
@@ -45,6 +45,8 @@ class PMSTestSuiteCLI(object):
 		opt.add_option('-p', '--package-manager', dest='pm',
 				help='Package manager to use',
 				default='portage')
+		opt.add_option('-P', '--pm-options', dest='pmopts',
+				help='Additional options to pass to the Package Manager (shell-quoted)')
 
 		self.optparser = opt
 
@@ -71,6 +73,7 @@ class PMSTestSuiteCLI(object):
 				break
 		else:
 			opt.error('Package manager not supported: %s' % opts.pm)
+		self.pm.pm_options = shlex.split(opts.pmopts)
 
 		try:
 			self.repository = EbuildRepository(opts.repo_path)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 0ab91b3..9a2d5ed 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -15,6 +15,7 @@ class PackageManager(object):
 	Base class for various package managers support.
 	"""
 
+	pm_options = []
 	repo_paths = []
 
 	@property

diff --git a/PMSTestSuite/pm/portage.py b/PMSTestSuite/pm/portage.py
index 4fbeda2..71672c0 100644
--- a/PMSTestSuite/pm/portage.py
+++ b/PMSTestSuite/pm/portage.py
@@ -36,11 +36,11 @@ class PortagePM(PackageManager):
 		os.chdir(startdir)
 
 	def merge(self, atoms):
-		ret = subprocess.call([self.emerge_path] + atoms,
+		ret = subprocess.call([self.emerge_path] + self.pm_options + atoms,
 				env = {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)})
 		return ret == 0
 
 	def unmerge(self, atoms):
-		ret = subprocess.call([self.emerge_path, '--unmerge'] + atoms,
+		ret = subprocess.call([self.emerge_path, '--unmerge'] + self.pm_options + atoms,
 				env = {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)})
 		return ret == 0



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

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

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

Support unmerging packages before proceeding.

---
 PMSTestSuite/pm/__init__.py |   10 ++++++++++
 PMSTestSuite/pm/portage.py  |    7 ++++++-
 PMSTestSuite/testrunner.py  |    2 ++
 3 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 8189f83..0ab91b3 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -60,6 +60,16 @@ class PackageManager(object):
 		"""
 		raise NotImplementedError('Please override the merge() method.')
 
+	def unmerge(self, atoms):
+		"""
+		Run PM to unmerge <atoms>.
+
+		Returns True if PM run successfully, False otherwise. Please note that
+		this return code may not have anything to do with ebuilds actually
+		getting removed.
+		"""
+		raise NotImplementedError('Please override the unmerge() method.')
+
 def get_package_managers():
 	""" Return the list of supported Package Managers. """
 

diff --git a/PMSTestSuite/pm/portage.py b/PMSTestSuite/pm/portage.py
index d31bd44..4fbeda2 100644
--- a/PMSTestSuite/pm/portage.py
+++ b/PMSTestSuite/pm/portage.py
@@ -22,7 +22,7 @@ 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)
@@ -39,3 +39,8 @@ class PortagePM(PackageManager):
 		ret = subprocess.call([self.emerge_path] + atoms,
 				env = {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)})
 		return ret == 0
+
+	def unmerge(self, atoms):
+		ret = subprocess.call([self.emerge_path, '--unmerge'] + atoms,
+				env = {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)})
+		return ret == 0

diff --git a/PMSTestSuite/testrunner.py b/PMSTestSuite/testrunner.py
index c1d2597..76f7071 100644
--- a/PMSTestSuite/testrunner.py
+++ b/PMSTestSuite/testrunner.py
@@ -9,6 +9,8 @@ class TestRunnerCLI(EbuildGenCLI):
 
 		self.pm.append_repository(self.repository)
 		atoms = ['=%s' % t.p for t in self.test_library]
+		print('-> Unmerging already-merged test ebuilds...')
+		self.pm.unmerge(atoms)
 		print('-> Running PM...')
 		self.pm.merge(atoms)
 



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

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

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

Use GLib main loop to asynchronically call emerge.

---
 PMSTestSuite/pm/__init__.py  |   10 ++++++++++
 PMSTestSuite/pm/portagepm.py |    9 +++++++++
 PMSTestSuite/testrunner.py   |   18 ++++++++++++++----
 3 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index cc6d3d5..f4e6355 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -81,6 +81,16 @@ 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_package_managers():
 	""" Return the list of supported Package Managers. """
 

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index d73406b..4b1e751 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -48,6 +48,15 @@ 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)
+
 	_vardb = None
 	@property
 	def vardb(self):

diff --git a/PMSTestSuite/testrunner.py b/PMSTestSuite/testrunner.py
index 703ae31..8ac4d6e 100644
--- a/PMSTestSuite/testrunner.py
+++ b/PMSTestSuite/testrunner.py
@@ -1,6 +1,13 @@
 from PMSTestSuite.ebuildgen import EbuildGenCLI
 
+import gobject
+
 class TestRunnerCLI(EbuildGenCLI):
+	def merge_done(self, pid, ret):
+		print(self.pm.lookup_vardb(self.cpvs))
+		self.ret = 0
+		self.loop.quit()
+
 	def main(self, argv):
 		print('-> Generating ebuilds...')
 		ret = EbuildGenCLI.main(self, argv)
@@ -8,14 +15,17 @@ class TestRunnerCLI(EbuildGenCLI):
 			return ret
 
 		self.pm.append_repository(self.repository)
-		cpvs = [t.p for t in self.test_library]
+		self.cpvs = [t.p for t in self.test_library]
 
-		installedcpvs = self.pm.lookup_vardb(cpvs)
+		installedcpvs = self.pm.lookup_vardb(self.cpvs)
 		if installedcpvs:
 			print('-> Unmerging already-merged test ebuilds...')
 			self.pm.unmerge(installedcpvs)
 
 		print('-> Running PM...')
-		self.pm.merge(cpvs)
+		self.loop = gobject.MainLoop()
+		gobject.child_watch_add(self.pm.merge_async(self.cpvs),
+				self.merge_done)
+		self.loop.run()
 
-		return 0
+		return self.ret



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

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

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

Pass cpvs to PM.merge()/unmerge(). Unmerge only when merged.

---
 PMSTestSuite/pm/__init__.py  |    8 ++++----
 PMSTestSuite/pm/portagepm.py |   13 ++++++++-----
 PMSTestSuite/testrunner.py   |   12 ++++++++----
 3 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 9838822..cc6d3d5 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -51,9 +51,9 @@ class PackageManager(object):
 		"""
 		self.repo_paths.append(repo.path)
 
-	def merge(self, atoms):
+	def merge(self, cpvs):
 		"""
-		Run PM to merge <atoms>.
+		Run PM to merge <cpvs>.
 
 		Returns True if PM run successfully, False otherwise. Please note that
 		this return code may not have anything to do with ebuilds actually
@@ -61,9 +61,9 @@ class PackageManager(object):
 		"""
 		raise NotImplementedError('Please override the merge() method.')
 
-	def unmerge(self, atoms):
+	def unmerge(self, cpvs):
 		"""
-		Run PM to unmerge <atoms>.
+		Run PM to unmerge <cpvs>.
 
 		Returns True if PM run successfully, False otherwise. Please note that
 		this return code may not have anything to do with ebuilds actually

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index 9d5fa0b..d73406b 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -35,14 +35,17 @@ class PortagePM(PackageManager):
 			subprocess.check_call([self.repoman_path, 'manifest'])
 		os.chdir(startdir)
 
-	def merge(self, atoms):
-		ret = subprocess.call([self.emerge_path] + self.pm_options + atoms,
+	def call_emerge(self, cpvs, opts = []):
+		return subprocess.call([self.emerge_path] + opts + self.pm_options
+				+ ['=%s' % cpv for cpv in cpvs],
 				env = {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)})
+
+	def merge(self, cpvs):
+		ret = self.call_emerge(cpvs)
 		return ret == 0
 
-	def unmerge(self, atoms):
-		ret = subprocess.call([self.emerge_path, '--unmerge'] + self.pm_options + atoms,
-				env = {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)})
+	def unmerge(self, cpvs):
+		ret = self.call_emerge(cpvs, ['--unmerge'])
 		return ret == 0
 
 	_vardb = None

diff --git a/PMSTestSuite/testrunner.py b/PMSTestSuite/testrunner.py
index 76f7071..703ae31 100644
--- a/PMSTestSuite/testrunner.py
+++ b/PMSTestSuite/testrunner.py
@@ -8,10 +8,14 @@ class TestRunnerCLI(EbuildGenCLI):
 			return ret
 
 		self.pm.append_repository(self.repository)
-		atoms = ['=%s' % t.p for t in self.test_library]
-		print('-> Unmerging already-merged test ebuilds...')
-		self.pm.unmerge(atoms)
+		cpvs = [t.p for t in self.test_library]
+
+		installedcpvs = self.pm.lookup_vardb(cpvs)
+		if installedcpvs:
+			print('-> Unmerging already-merged test ebuilds...')
+			self.pm.unmerge(installedcpvs)
+
 		print('-> Running PM...')
-		self.pm.merge(atoms)
+		self.pm.merge(cpvs)
 
 		return 0



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

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

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

Keep gid & umask clean to support userpriv.

---
 PMSTestSuite/cli.py          |    9 ++++++++-
 PMSTestSuite/pm/__init__.py  |    9 +++++++++
 PMSTestSuite/pm/portagepm.py |    5 +++++
 3 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/PMSTestSuite/cli.py b/PMSTestSuite/cli.py
index b62c837..bfe4713 100644
--- a/PMSTestSuite/cli.py
+++ b/PMSTestSuite/cli.py
@@ -2,7 +2,7 @@
 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-import os.path, shlex
+import os, os.path, shlex
 import gobject
 
 from optparse import OptionParser
@@ -76,6 +76,13 @@ class PMSTestSuiteCLI(object):
 			opt.error('Package manager not supported: %s' % opts.pm)
 		self.pm.pm_options = shlex.split(opts.pmopts) if opts.pmopts else []
 
+		userpriv_group = self.pm.get_userpriv_group()
+		if userpriv_group is not None:
+			os.setgid(userpriv_group)
+			os.umask(027)
+		else:
+			os.umask(077)
+
 		try:
 			self.repository = NewEbuildRepository(opts.repo_path, 'pms-test-suite')
 		except (OSError, IOError, ValueError) as e:

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index f4e6355..54204da 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -91,6 +91,15 @@ class PackageManager(object):
 		"""
 		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.
+		
+		If userpriv is not in effect, returns None (no need for ownership
+		changes).
+		"""
+		raise NotImplementedError('Please override the get_userpriv_group() 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 da50bc2..8a980bb 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -75,3 +75,8 @@ class PortagePM(PackageManager):
 		installed_cpvs = set(self.vardb.cpv_all())
 		installed_cpvs &= set(cpvs)
 		return installed_cpvs
+
+	def get_userpriv_group(self):
+		# XXX: check for FEATURES=userpriv
+		from portage.data import userpriv_groups
+		return userpriv_groups[0]



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

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

commit:     d6b74a481606215a20933f177b2d0f8ec633a49d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 11 06:31:36 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 06:31:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=d6b74a48

Limit the number of packages merged at once if PM is fatal.

If the Package Manager treats merge failures as fatal for the whole
merge process, merge at most a single package at once.

---
 PMSTestSuite/cli.py          |    4 ++++
 PMSTestSuite/pm/__init__.py  |    9 +++++++++
 PMSTestSuite/pm/pkgcorepm.py |    1 +
 PMSTestSuite/pm/portagepm.py |    1 +
 4 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/PMSTestSuite/cli.py b/PMSTestSuite/cli.py
index b50960b..2798831 100644
--- a/PMSTestSuite/cli.py
+++ b/PMSTestSuite/cli.py
@@ -172,6 +172,10 @@ class PMSTestSuiteCLI(object):
 				return 1
 
 		print('-> Running PM...')
+		# if failures are fatal to PM, we can merge at most one package at once
+		if not self.pm.failure_nonfatal:
+			self.limit_packages = 1
+
 		self.loop = gobject.MainLoop()
 		self.package_queue = list(self.cpvs)
 		self.start_pm()

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 7a9256e..c58deaa 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -32,6 +32,15 @@ class PackageManager(object):
 		"""
 		raise NotImplementedError('Please override the pkg property.')
 
+	@property
+	def failure_nonfatal(self):
+		"""
+		A bool stating whether the package manager will treat failures
+		as non-fatal to the overall merge process (if it will continue merging
+		when one of the ebuilds fail, aka --keep-going).
+		"""
+		return False
+
 	@classmethod
 	def is_available(cls):
 		"""

diff --git a/PMSTestSuite/pm/pkgcorepm.py b/PMSTestSuite/pm/pkgcorepm.py
index 0d64cd7..7e85cc1 100644
--- a/PMSTestSuite/pm/pkgcorepm.py
+++ b/PMSTestSuite/pm/pkgcorepm.py
@@ -22,6 +22,7 @@ class PkgCorePM(PortagePM):
 	"""
 	name = 'pkgcore'
 	pkg = 'sys-apps/pkgcore'
+	failure_nonfatal = False
 
 	pmerge_path = '/usr/bin/pmerge'
 

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index bfc7fbf..19f3f8a 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -17,6 +17,7 @@ class PortagePM(PackageManager):
 	""" A class implementing the interfaces to the Portage PM. """
 	name = 'portage'
 	pkg = 'sys-apps/portage'
+	failure_nonfatal = True
 
 	emerge_path = '/usr/bin/emerge'
 	repoman_path = '/usr/bin/repoman'



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

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

commit:     c2f6c681873303539a272422908edc9888249e86
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 15 14:40:56 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jun 15 15:20:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=c2f6c681

Start implementing a new PM API.

The new PM API allows queueing packages before running the actual
operation (merge/unmerge).

---
 PMSTestSuite/cli.py          |    3 +-
 PMSTestSuite/pm/__init__.py  |   67 +++++++++++++++++++++++++++++++++++-------
 PMSTestSuite/pm/pkgcorepm.py |   17 ++--------
 PMSTestSuite/pm/portagepm.py |   17 ++--------
 4 files changed, 66 insertions(+), 38 deletions(-)

diff --git a/PMSTestSuite/cli.py b/PMSTestSuite/cli.py
index 5820ec7..6f98225 100644
--- a/PMSTestSuite/cli.py
+++ b/PMSTestSuite/cli.py
@@ -142,7 +142,7 @@ class PMSTestSuiteCLI(object):
 			pkgs = self.package_queue
 			self.package_queue = []
 
-		gobject.child_watch_add(self.pm.merge_async(pkgs),
+		gobject.child_watch_add(self.pm._spawn_merge(pkgs).pid,
 				self.merge_done)
 
 	def main(self, argv):
@@ -164,6 +164,7 @@ class PMSTestSuiteCLI(object):
 		if installedcpvs:
 			print('-> Unmerging already-merged test ebuilds...')
 			self.pm.unmerge(installedcpvs)
+			self.pm.commit()
 			installedcpvs = self.pm.lookup_vardb(self.cpvs)
 			if installedcpvs:
 				print('Failed to unmerge the following test ebuilds:')

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index c58deaa..3172a1d 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -10,6 +10,10 @@ True
 '...'
 """
 
+class PackageManagerOps:
+	merge = 0
+	unmerge = 1
+
 class PackageManager(object):
 	"""
 	Base class for various package managers support.
@@ -17,6 +21,8 @@ class PackageManager(object):
 
 	pm_options = []
 	repo_paths = []
+	pkg_queue = []
+	_current_op = None
 
 	@property
 	def name(self):
@@ -69,25 +75,64 @@ class PackageManager(object):
 		"""
 		raise NotImplementedError('Please override the get_repository() method.')
 
+	@property
+	def op(self):
+		return self._current_op
+
+	@op.setter
+	def op(self, op):
+		if self._current_op is not None:
+			if self._current_op == op:
+				return
+			raise Exception('Please commit the pending operation first.')
+		self._current_op = op
+
+	@op.deleter
+	def op(self):
+		self._current_op = None
+		self.pkg_queue = []
+
 	def merge(self, cpvs):
 		"""
-		Run PM to merge <cpvs>.
-
-		Returns True if PM run successfully, False otherwise. Please note that
-		this return code may not have anything to do with ebuilds actually
-		getting merged.
+		Queue merging <cpvs> (either a list or a string).
 		"""
-		raise NotImplementedError('Please override the merge() method.')
+		self.op = PackageManagerOps.merge
+		self.pkg_queue.extend(cpvs)
 
 	def unmerge(self, cpvs):
 		"""
-		Run PM to unmerge <cpvs>.
+		Queue unmerging <cpvs> (either a list or a string).
+		"""
+		self.op = PackageManagerOps.unmerge
+		self.pkg_queue.extend(cpvs)
+
+	def _spawn_merge(self, pkgs):
+		"""
+		Spawn PM to perform merge of <pkgs>. Returns a subprocess.
+		"""
+		raise NotImplementedError('Please override _spawn_merge()')
+
+	def _spawn_unmerge(self, pkgs):
+		"""
+		Spawn PM to perform unmerge of <pkgs>. Returns a subprocess.
+		"""
+		raise NotImplementedError('Please override _spawn_unmerge()')
 
-		Returns True if PM run successfully, False otherwise. Please note that
-		this return code may not have anything to do with ebuilds actually
-		getting removed.
+	def commit(self):
 		"""
-		raise NotImplementedError('Please override the unmerge() method.')
+		Perform queued operations, starting PM multiple times if necessary.
+		Block execution until done.
+		"""
+
+		if self.op == PackageManagerOps.merge:
+			subp = self._spawn_merge(self.pkg_queue)
+		elif self.op == PackageManagerOps.unmerge:
+			subp = self._spawn_unmerge(self.pkg_queue)
+		else:
+			raise AssertionError('PackageManager.op unmatched')
+
+		subp.wait()
+		del self.op
 
 	def lookup_vardb(self, cpvs):
 		"""

diff --git a/PMSTestSuite/pm/pkgcorepm.py b/PMSTestSuite/pm/pkgcorepm.py
index 7e85cc1..a29f1bd 100644
--- a/PMSTestSuite/pm/pkgcorepm.py
+++ b/PMSTestSuite/pm/pkgcorepm.py
@@ -45,20 +45,11 @@ class PkgCorePM(PortagePM):
 				+ 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 _spawn_merge(self, cpvs):
+		return self.spawn_pmerge(cpvs)
 
-	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 _spawn_unmerge(self, cpvs):
+		return self.spawn_pmerge(cpvs, ['--unmerge'])
 
 	def append_repository(self, repo):
 		raise NotImplementedError('PkgCorePM does not support adding repositories yet.')

diff --git a/PMSTestSuite/pm/portagepm.py b/PMSTestSuite/pm/portagepm.py
index 66310f4..7d6c6a5 100644
--- a/PMSTestSuite/pm/portagepm.py
+++ b/PMSTestSuite/pm/portagepm.py
@@ -57,20 +57,11 @@ class PortagePM(PackageManager):
 				+ ['=%s' % cpv for cpv in cpvs],
 				**kwargs)
 
-	def call_emerge(self, *args, **kwargs):
-		p = self.spawn_emerge(*args, **kwargs)
-		return p.wait()
+	def _spawn_merge(self, cpvs):
+		return self.spawn_emerge(cpvs)
 
-	def merge(self, cpvs):
-		ret = self.call_emerge(cpvs)
-		return ret == 0
-
-	def unmerge(self, cpvs):
-		ret = self.call_emerge(cpvs, ['--unmerge'])
-		return ret == 0
-
-	def merge_async(self, cpvs):
-		return self.spawn_emerge(cpvs).pid
+	def _spawn_unmerge(self, cpvs):
+		return self.spawn_emerge(cpvs, ['--unmerge'])
 
 	_vardb = None
 	_portdb = None



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

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

commit:     d0a35b6ada052a1aedd2868532ec4066f46e7a9a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 15 16:01:34 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jun 15 16:01:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=d0a35b6a

Use callback-based PM API.

---
 PMSTestSuite/cli.py         |   55 +++++++++++++++++++++++++------------------
 PMSTestSuite/pm/__init__.py |   18 ++++++++++----
 2 files changed, 45 insertions(+), 28 deletions(-)

diff --git a/PMSTestSuite/cli.py b/PMSTestSuite/cli.py
index 6f98225..1eba0a7 100644
--- a/PMSTestSuite/cli.py
+++ b/PMSTestSuite/cli.py
@@ -105,18 +105,22 @@ class PMSTestSuiteCLI(object):
 		self.limit_packages = opts.limit_pkgs
 
 	def tests_done(self):
+		self.merged_pkgs = frozenset(self.pm.lookup_vardb(self.cpvs))
+		if self.merged_pkgs:
+			print('-> Unmerging test ebuilds...')
+			self.pm.unmerge(self.merged_pkgs)
+			self.pm.commit(self.all_done)
+		else:
+			self.all_done()
+
+	def all_done(self):
 		failed = []
 
-		cpvs = frozenset(self.pm.lookup_vardb(self.cpvs))
 		for t in self.test_library:
-			res = t.check_result(t.cpv in cpvs)
+			res = t.check_result(t.cpv in self.merged_pkgs)
 			if not res:
 				failed.append(t)
 
-		if cpvs:
-			print('-> Unmerging test ebuilds...')
-			self.pm.unmerge(cpvs)
-
 		if not failed:
 			print('%d tests completed successfully.' % len(self.cpvs))
 		else:
@@ -128,13 +132,14 @@ class PMSTestSuiteCLI(object):
 		self.ret = 0 if not failed else 1
 		self.loop.quit()
 
-	def merge_done(self, pid, ret):
+	def merge_done(self):
 		if self.package_queue:
 			self.start_pm()
 		else:
 			self.tests_done()
 
 	def start_pm(self):
+		print('-> Running PM...')
 		if self.limit_packages:
 			pkgs = self.package_queue[:self.limit_packages]
 			del self.package_queue[:self.limit_packages]
@@ -142,8 +147,19 @@ class PMSTestSuiteCLI(object):
 			pkgs = self.package_queue
 			self.package_queue = []
 
-		gobject.child_watch_add(self.pm._spawn_merge(pkgs).pid,
-				self.merge_done)
+		self.pm.merge(pkgs)
+		self.pm.commit(self.merge_done)
+
+	def pre_unmerge_done(self):
+		installedcpvs = self.pm.lookup_vardb(self.cpvs)
+		if installedcpvs:
+			print('Failed to unmerge the following test ebuilds:')
+			print(' '.join(installedcpvs))
+			print('Refusing to proceed.')
+			self.ret = 1
+			self.loop.quit()
+			return
+		self.start_pm()
 
 	def main(self, argv):
 		self._start(*argv)
@@ -160,26 +176,19 @@ class PMSTestSuiteCLI(object):
 
 		self.cpvs = [t.cpv for t in self.test_library]
 
+		self.package_queue = list(self.cpvs)
+		if not self.pm.failure_nonfatal:
+			self.limit_packages = 1
+
 		installedcpvs = self.pm.lookup_vardb(self.cpvs)
 		if installedcpvs:
 			print('-> Unmerging already-merged test ebuilds...')
 			self.pm.unmerge(installedcpvs)
-			self.pm.commit()
-			installedcpvs = self.pm.lookup_vardb(self.cpvs)
-			if installedcpvs:
-				print('Failed to unmerge the following test ebuilds:')
-				print(' '.join(installedcpvs))
-				print('Refusing to proceed.')
-				return 1
-
-		print('-> Running PM...')
-		# if failures are fatal to PM, we can merge at most one package at once
-		if not self.pm.failure_nonfatal:
-			self.limit_packages = 1
+			self.pm.commit(self.pre_unmerge_done)
+		else:
+			self.start_pm()
 
 		self.loop = gobject.MainLoop()
-		self.package_queue = list(self.cpvs)
-		self.start_pm()
 		self.loop.run()
 
 		return self.ret

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 3172a1d..c066890 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -10,6 +10,8 @@ True
 '...'
 """
 
+import gobject
+
 class PackageManagerOps:
 	merge = 0
 	unmerge = 1
@@ -118,10 +120,15 @@ class PackageManager(object):
 		"""
 		raise NotImplementedError('Please override _spawn_unmerge()')
 
-	def commit(self):
+	def _subprocess_done(self, pid, exitcode, callback):
+		assert(pid == self._curr_pid)
+		del self.op
+		callback()
+
+	def commit(self, callback):
 		"""
-		Perform queued operations, starting PM multiple times if necessary.
-		Block execution until done.
+		Perform queued operations in the background (using glib), starting PM
+		multiple times if necessary. Call <callback> when done.
 		"""
 
 		if self.op == PackageManagerOps.merge:
@@ -131,8 +138,9 @@ class PackageManager(object):
 		else:
 			raise AssertionError('PackageManager.op unmatched')
 
-		subp.wait()
-		del self.op
+		self._curr_pid = subp.pid
+		gobject.child_watch_add(subp.pid, self._subprocess_done,
+				callback)
 
 	def lookup_vardb(self, cpvs):
 		"""



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

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

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

Move package limiting to PackageManager.

---
 PMSTestSuite/cli.py         |   18 ++----------------
 PMSTestSuite/pm/__init__.py |   13 ++++++++++++-
 2 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/PMSTestSuite/cli.py b/PMSTestSuite/cli.py
index 6975bfe..4b08bb8 100644
--- a/PMSTestSuite/cli.py
+++ b/PMSTestSuite/cli.py
@@ -132,23 +132,10 @@ class PMSTestSuiteCLI(object):
 		self.ret = 0 if not failed else 1
 		self.loop.quit()
 
-	def merge_done(self):
-		if self.package_queue:
-			self.start_pm()
-		else:
-			self.tests_done()
-
 	def start_pm(self):
 		print('-> Running PM...')
-		if self.limit_packages:
-			pkgs = self.package_queue[:self.limit_packages]
-			del self.package_queue[:self.limit_packages]
-		else:
-			pkgs = self.package_queue
-			self.package_queue = []
-
-		self.pm.merge(pkgs)
-		self.pm.commit(self.merge_done)
+		self.pm.merge(self.package_queue)
+		self.pm.commit(self.tests_done)
 
 	def pre_unmerge_done(self):
 		installedcpvs = self.pm.lookup_vardb(self.cpvs)
@@ -176,7 +163,6 @@ class PMSTestSuiteCLI(object):
 		self.cpvs = [t.cpv for t in self.test_library]
 
 		self.package_queue = list(self.cpvs)
-		self.limit_packages = self.pm.package_limit
 
 		installedcpvs = self.pm.lookup_vardb(self.cpvs)
 		if installedcpvs:

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index 588f308..02e9016 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -124,6 +124,12 @@ class PackageManager(object):
 
 	def _subprocess_done(self, pid, exitcode, callback):
 		assert(pid == self._curr_pid)
+
+		if self.op == PackageManagerOps.merge:
+			if self.package_limit and self.pkg_queue:
+				self.commit(callback)
+				return
+
 		del self.op
 		callback()
 
@@ -134,7 +140,12 @@ class PackageManager(object):
 		"""
 
 		if self.op == PackageManagerOps.merge:
-			subp = self._spawn_merge(self.pkg_queue)
+			if self.package_limit:
+				pkgs = self.pkg_queue[:self.package_limit]
+				del self.pkg_queue[:self.package_limit]
+			else:
+				pkgs = self.pkg_queue
+			subp = self._spawn_merge(pkgs)
 		elif self.op == PackageManagerOps.unmerge:
 			subp = self._spawn_unmerge(self.pkg_queue)
 		else:



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

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

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

Keep package limit in PackageManager instance.

---
 PMSTestSuite/cli.py          |    5 ++---
 PMSTestSuite/pm/__init__.py  |    2 ++
 PMSTestSuite/pm/pkgcorepm.py |    8 ++++++++
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/PMSTestSuite/cli.py b/PMSTestSuite/cli.py
index 89a498a..6975bfe 100644
--- a/PMSTestSuite/cli.py
+++ b/PMSTestSuite/cli.py
@@ -102,7 +102,7 @@ class PMSTestSuiteCLI(object):
 		except (ImportError, TypeError) as e:
 			opt.error('Test library load failed: %s' % e)
 
-		self.limit_packages = opts.limit_pkgs
+		self.pm.package_limit = opts.limit_pkgs
 
 	def tests_done(self):
 		self.merged_pkgs = frozenset(self.pm.lookup_vardb(self.cpvs))
@@ -176,8 +176,7 @@ class PMSTestSuiteCLI(object):
 		self.cpvs = [t.cpv for t in self.test_library]
 
 		self.package_queue = list(self.cpvs)
-		if not self.pm.failure_nonfatal:
-			self.limit_packages = 1
+		self.limit_packages = self.pm.package_limit
 
 		installedcpvs = self.pm.lookup_vardb(self.cpvs)
 		if installedcpvs:

diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py
index c066890..588f308 100644
--- a/PMSTestSuite/pm/__init__.py
+++ b/PMSTestSuite/pm/__init__.py
@@ -24,6 +24,8 @@ class PackageManager(object):
 	pm_options = []
 	repo_paths = []
 	pkg_queue = []
+	package_limit = None
+
 	_current_op = None
 
 	@property

diff --git a/PMSTestSuite/pm/pkgcorepm.py b/PMSTestSuite/pm/pkgcorepm.py
index a29f1bd..ba1b1a0 100644
--- a/PMSTestSuite/pm/pkgcorepm.py
+++ b/PMSTestSuite/pm/pkgcorepm.py
@@ -40,6 +40,14 @@ class PkgCorePM(PortagePM):
 			ret &= os.access(prog, os.X_OK)
 		return ret
 
+	@property
+	def package_limit(self):
+		return 1
+
+	@package_limit.setter
+	def package_limit(self, val):
+		pass
+
 	def spawn_pmerge(self, cpvs, opts = []):
 		return subprocess.Popen([self.pmerge_path]
 				+ self.common_pmerge_opts + opts + self.pm_options



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

end of thread, other threads:[~2011-06-16 17:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-31  8:10 [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/, PMSTestSuite/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2011-06-16 17:22 Michał Górny
2011-06-16 17:22 Michał Górny
2011-06-15 16:14 Michał Górny
2011-06-15 16:14 Michał Górny
2011-06-11  6:32 Michał Górny
2011-06-06  7:29 Michał Górny
2011-05-31 12:14 Michał Górny
2011-05-31 12:14 Michał Górny
2011-05-31  8:10 Michał Górny
2011-05-29 18:57 Michał Górny
2011-05-29 18:57 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