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 1QQlBE-0001ay-Bq for garchives@archives.gentoo.org; Sun, 29 May 2011 18:57:40 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 471871C0F7; Sun, 29 May 2011 18:57:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 14A1A1C0C2 for ; Sun, 29 May 2011 18:57:16 +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 844B61B405F for ; Sun, 29 May 2011 18:57:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id EAA908001C for ; Sun, 29 May 2011 18:57:14 +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: <969ba3809b72fa16d395ec099f41fbc3d735bcb9.mgorny@gentoo> 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/portage.py PMSTestSuite/testrunner.py X-VCS-Directories: PMSTestSuite/pm/ PMSTestSuite/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 969ba3809b72fa16d395ec099f41fbc3d735bcb9 Date: Sun, 29 May 2011 18:57:14 +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: da002cdce56e59eaa74f3567c790ed97 commit: 969ba3809b72fa16d395ec099f41fbc3d735bcb9 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Sun May 29 18:51:16 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Sun May 29 18:51:16 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3D969ba380 Support passing repo paths to PM. --- PMSTestSuite/pm/__init__.py | 8 ++++++++ PMSTestSuite/pm/portage.py | 7 +++++-- PMSTestSuite/testrunner.py | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/PMSTestSuite/pm/__init__.py b/PMSTestSuite/pm/__init__.py index 08b7c25..8189f83 100644 --- a/PMSTestSuite/pm/__init__.py +++ b/PMSTestSuite/pm/__init__.py @@ -15,6 +15,8 @@ class PackageManager(object): Base class for various package managers support. """ =20 + repo_paths =3D [] + @property def name(self): """ Human-readable, short PM name (used in option values). """ @@ -42,6 +44,12 @@ class PackageManager(object): """ Regenerate Manifests in given (should be iterable). """ raise NotImplementedError('Please override the remanifest() method.') =20 + def append_repository(self, repo): + """ + Append the repository (EbuildRepository) to PM's list of repos. + """ + self.repo_paths.append(repo.path) + def merge(self, atoms): """ Run PM to merge . diff --git a/PMSTestSuite/pm/portage.py b/PMSTestSuite/pm/portage.py index 8326856..8a7763f 100644 --- a/PMSTestSuite/pm/portage.py +++ b/PMSTestSuite/pm/portage.py @@ -2,7 +2,7 @@ # (c) 2011 Micha=C5=82 G=C3=B3rny # Released under the terms of the 2-clause BSD license. =20 -import os, subprocess +import os, os.path, subprocess =20 from PMSTestSuite.pm import PackageManager =20 @@ -14,6 +14,8 @@ class PortagePM(PackageManager): emerge_path =3D '/usr/bin/emerge' repoman_path =3D '/usr/bin/repoman' =20 + repo_paths =3D [] + @classmethod def is_available(cls): try: @@ -32,5 +34,6 @@ class PortagePM(PackageManager): subprocess.check_call([self.repoman_path, 'manifest']) =20 def merge(self, atoms): - ret =3D subprocess.call([self.emerge_path] + atoms) + ret =3D subprocess.call([self.emerge_path] + atoms, + env =3D {'PORTDIR_OVERLAY': ' '.join(self.repo_paths)}) return ret =3D=3D 0 diff --git a/PMSTestSuite/testrunner.py b/PMSTestSuite/testrunner.py index d7ca5c5..c1d2597 100644 --- a/PMSTestSuite/testrunner.py +++ b/PMSTestSuite/testrunner.py @@ -7,6 +7,7 @@ class TestRunnerCLI(EbuildGenCLI): if ret !=3D 0: return ret =20 + self.pm.append_repository(self.repository) atoms =3D ['=3D%s' % t.p for t in self.test_library] print('-> Running PM...') self.pm.merge(atoms)