Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/pm/
Date: Thu, 26 May 2011 09:46:06
Message-Id: 7db2f02288ebcad988119a2ea50169052c450e6e.mgorny@gentoo
1 commit: 7db2f02288ebcad988119a2ea50169052c450e6e
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 26 09:43:12 2011 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu May 26 09:43:12 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=7db2f022
7
8 Add a more extensive test for PM availability.
9
10 ---
11 PMSTestSuite/pm/portage.py | 10 +++++++++-
12 1 files changed, 9 insertions(+), 1 deletions(-)
13
14 diff --git a/PMSTestSuite/pm/portage.py b/PMSTestSuite/pm/portage.py
15 index 51770b1..c63fd49 100644
16 --- a/PMSTestSuite/pm/portage.py
17 +++ b/PMSTestSuite/pm/portage.py
18 @@ -16,7 +16,15 @@ class PortagePM(PackageManager):
19
20 @classmethod
21 def is_available(cls):
22 - return os.access(cls.emerge_path, os.X_OK)
23 + try:
24 + import portage
25 + except ImportError:
26 + return False
27 +
28 + ret = True
29 + for prog in (cls.emerge_path, cls.repoman_path):
30 + ret &= os.access(prog, os.X_OK)
31 + return ret
32
33 def remanifest(self, paths):
34 for path in paths: