1 |
commit: b5d9509982de6463c68c4c2dfd9ee248f3a31996 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 5 16:22:32 2015 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 5 16:22:32 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=b5d95099 |
7 |
|
8 |
make-worldconf: fix reading from /etc/portage. |
9 |
|
10 |
make-worldconf | 15 +++++++++------ |
11 |
1 file changed, 9 insertions(+), 6 deletions(-) |
12 |
|
13 |
diff --git a/make-worldconf b/make-worldconf |
14 |
index 85f63b0..9408aef 100755 |
15 |
--- a/make-worldconf |
16 |
+++ b/make-worldconf |
17 |
@@ -86,8 +86,11 @@ def keywords(config, p): |
18 |
config[p.slot_atom]['package.accept_keywords'] = '=%s %s' % (p.cpv, keyword) |
19 |
|
20 |
|
21 |
-def others(config, p, subdir): |
22 |
- fpath = os.path.join(CONST.PORTAGE_CONFIGDIR, subdir) |
23 |
+def from_etc_portage(config, p, subdir): |
24 |
+ # We could add better matching intelligence here so as to match |
25 |
+ # these subdirs+files for /etc/portage not maintained by GRS. |
26 |
+ fpath = os.path.join(CONST.PORTAGE_CONFIGDIR, '%s/%s' % \ |
27 |
+ (subdir, re.sub('[/:]', '_', p.slot_atom))) |
28 |
if os.path.isfile(fpath): |
29 |
with open(fpath, 'r') as g: |
30 |
config[p.slot_atom][subdir] = g.read() |
31 |
@@ -121,10 +124,10 @@ def main(): |
32 |
keywords(config, p) |
33 |
|
34 |
# Others - these are read out of /etc/portage |
35 |
- others(config, p, 'env') |
36 |
- others(config, p, 'package.env') |
37 |
- others(config, p, 'package.mask') |
38 |
- others(config, p, 'package.unmask') |
39 |
+ from_etc_portage(config, p, 'env') |
40 |
+ from_etc_portage(config, p, 'package.env') |
41 |
+ from_etc_portage(config, p, 'package.mask') |
42 |
+ from_etc_portage(config, p, 'package.unmask') |
43 |
|
44 |
# Remove any empty sections |
45 |
if config[p.slot_atom] == {}: |