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

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)
 



             reply	other threads:[~2011-05-31  8:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31  8:10 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-06-16 17:22 [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/, PMSTestSuite/ 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

Reply instructions:

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

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

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

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

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

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

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