From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QRUUB-0004Hk-D6 for garchives@archives.gentoo.org; Tue, 31 May 2011 19:20:15 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8F2D31C15D; Tue, 31 May 2011 19:18:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5A1181C15D for ; Tue, 31 May 2011 19:18:58 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E7CF91B4026 for ; Tue, 31 May 2011 19:18:57 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 4E9E48001D for ; Tue, 31 May 2011 19:18:57 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: Subject: [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: PMSTestSuite/pm/portagepm.py X-VCS-Directories: PMSTestSuite/pm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: ff8ceaa0d7f2b2ea2bde774d980ace0c141b7241 Date: Tue, 31 May 2011 19:18:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 1d3971acca8cbf283ff6f4d4d4e87108 commit: ff8ceaa0d7f2b2ea2bde774d980ace0c141b7241 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Tue May 31 19:13:35 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Tue May 31 19:13:35 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3Dff8ceaa0 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) =20 - def call_emerge(self, cpvs, opts =3D []): - return subprocess.call([self.emerge_path] + opts + self.pm_options + def spawn_emerge(self, cpvs, opts =3D []): + return subprocess.Popen([self.emerge_path] + opts + self.pm_options + ['=3D%s' % cpv for cpv in cpvs], env =3D {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)}) =20 + def call_emerge(self, *args, **kwargs): + p =3D self.spawn_emerge(*args, **kwargs) + return p.wait() + def merge(self, cpvs): ret =3D self.call_emerge(cpvs) return ret =3D=3D 0 @@ -48,14 +52,8 @@ class PortagePM(PackageManager): ret =3D self.call_emerge(cpvs, ['--unmerge']) return ret =3D=3D 0 =20 - def spawn_emerge(self, cpvs, opts =3D []): - p =3D subprocess.Popen([self.emerge_path] + opts + self.pm_options - + ['=3D%s' % cpv for cpv in cpvs], - env =3D {'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 =20 _vardb =3D None @property