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 1QRNqR-0004wY-Nn for garchives@archives.gentoo.org; Tue, 31 May 2011 12:14:47 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 748BC1C034; Tue, 31 May 2011 12:14:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 301EC1C034 for ; Tue, 31 May 2011 12:14:40 +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 A4E531B400F for ; Tue, 31 May 2011 12:14:39 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id A76A28050D for ; Tue, 31 May 2011 12:14:38 +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/, PMSTestSuite/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: PMSTestSuite/pm/__init__.py PMSTestSuite/pm/portagepm.py PMSTestSuite/testrunner.py X-VCS-Directories: PMSTestSuite/pm/ PMSTestSuite/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: bf3905892670dd294eb8ae5680920b09d1c77230 Date: Tue, 31 May 2011 12:14:38 +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: cd29645ddbd50ba5b943703da2ed14a1 commit: bf3905892670dd294eb8ae5680920b09d1c77230 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Tue May 31 11:44:32 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Tue May 31 11:44:32 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3Dbf390589 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) =20 - def merge(self, atoms): + def merge(self, cpvs): """ - Run PM to merge . + Run PM to merge . =20 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.') =20 - def unmerge(self, atoms): + def unmerge(self, cpvs): """ - Run PM to unmerge . + Run PM to unmerge . =20 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) =20 - def merge(self, atoms): - ret =3D subprocess.call([self.emerge_path] + self.pm_options + atoms, + def call_emerge(self, cpvs, opts =3D []): + return subprocess.call([self.emerge_path] + opts + self.pm_options + + ['=3D%s' % cpv for cpv in cpvs], env =3D {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)}) + + def merge(self, cpvs): + ret =3D self.call_emerge(cpvs) return ret =3D=3D 0 =20 - def unmerge(self, atoms): - ret =3D subprocess.call([self.emerge_path, '--unmerge'] + self.pm_opti= ons + atoms, - env =3D {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)}) + def unmerge(self, cpvs): + ret =3D self.call_emerge(cpvs, ['--unmerge']) return ret =3D=3D 0 =20 _vardb =3D 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 =20 self.pm.append_repository(self.repository) - atoms =3D ['=3D%s' % t.p for t in self.test_library] - print('-> Unmerging already-merged test ebuilds...') - self.pm.unmerge(atoms) + cpvs =3D [t.p for t in self.test_library] + + installedcpvs =3D 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) =20 return 0