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: <4c4d152413a0b112eb0ba35528b492c0f8d95e7a.mgorny@gentoo> (raw)

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



             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=4c4d152413a0b112eb0ba35528b492c0f8d95e7a.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