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: Thu, 16 Jun 2011 17:22:22 +0000 (UTC) [thread overview]
Message-ID: <88002986eaf6c7ebc9a01dbb5904661c78efb628.mgorny@gentoo> (raw)
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:
next reply other threads:[~2011-06-16 17:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-16 17:22 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-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-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=88002986eaf6c7ebc9a01dbb5904661c78efb628.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