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 1QPX8n-0001E5-P3 for garchives@archives.gentoo.org; Thu, 26 May 2011 09:46:06 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6BF871C03A; Thu, 26 May 2011 09:45:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 389471C03A for ; Thu, 26 May 2011 09:45: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 C39861B402D for ; Thu, 26 May 2011 09:45:57 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 03EA580505 for ; Thu, 26 May 2011 09:45: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: <7db2f02288ebcad988119a2ea50169052c450e6e.mgorny@gentoo> Subject: [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: PMSTestSuite/pm/portage.py X-VCS-Directories: PMSTestSuite/pm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 7db2f02288ebcad988119a2ea50169052c450e6e Date: Thu, 26 May 2011 09:45: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: cdcf8701a71eae30e2cfdaba5dee2a7a commit: 7db2f02288ebcad988119a2ea50169052c450e6e Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Thu May 26 09:43:12 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Thu May 26 09:43:12 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3D7db2f022 Add a more extensive test for PM availability. --- PMSTestSuite/pm/portage.py | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/PMSTestSuite/pm/portage.py b/PMSTestSuite/pm/portage.py index 51770b1..c63fd49 100644 --- a/PMSTestSuite/pm/portage.py +++ b/PMSTestSuite/pm/portage.py @@ -16,7 +16,15 @@ class PortagePM(PackageManager): =20 @classmethod def is_available(cls): - return os.access(cls.emerge_path, os.X_OK) + try: + import portage + except ImportError: + return False + =09 + ret =3D True + for prog in (cls.emerge_path, cls.repoman_path): + ret &=3D os.access(prog, os.X_OK) + return ret =20 def remanifest(self, paths): for path in paths: