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/repository/
Date: Wed, 01 Jun 2011 12:31:00
Message-Id: 3fc667d086c6fad218a86ffc0e9cc6e5f856ece2.mgorny@gentoo
1 commit: 3fc667d086c6fad218a86ffc0e9cc6e5f856ece2
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 1 11:53:22 2011 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 1 11:53:22 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=3fc667d0
7
8 Require added ebuilds to match supported categories.
9
10 ---
11 PMSTestSuite/repository/__init__.py | 12 ++++++++++++
12 1 files changed, 12 insertions(+), 0 deletions(-)
13
14 diff --git a/PMSTestSuite/repository/__init__.py b/PMSTestSuite/repository/__init__.py
15 index 63af3dc..4496361 100644
16 --- a/PMSTestSuite/repository/__init__.py
17 +++ b/PMSTestSuite/repository/__init__.py
18 @@ -43,6 +43,14 @@ class EbuildRepository(object):
19 def write_files(self, files):
20 """ Write files from files dict to the repository. """
21 for fn, c in files.items():
22 + head = fn
23 + while head:
24 + head, tail = os.path.split(head)
25 + if tail in ('eclass', 'profiles'):
26 + pass
27 + elif tail not in self.categories:
28 + self.add_category(tail)
29 +
30 fp = os.path.join(self.path, fn)
31 if not os.path.exists(os.path.dirname(fp)):
32 os.makedirs(os.path.dirname(fp))
33 @@ -54,6 +62,10 @@ class EbuildRepository(object):
34 """ Remanifest files from <files> dict using <pm>. """
35 dirs = frozenset([os.path.join(self.path, os.path.dirname(f)) for f in files])
36 pm.remanifest(dirs)
37 +
38 + def add_category(self, catname):
39 + """ Add category <catname> to profiles/categories. """
40 + raise ValueError("The repository doesn't support %s category." % catname)
41
42 class NewEbuildRepository(EbuildRepository):
43 """