1 |
commit: a41470af307df90f2be041900dceeed7114d4b74 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 5 16:13:39 2015 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 5 16:13:39 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=a41470af |
7 |
|
8 |
make-worldconf: change structure of world.conf. |
9 |
|
10 |
make-worldconf | 33 ++++++--------------------------- |
11 |
1 file changed, 6 insertions(+), 27 deletions(-) |
12 |
|
13 |
diff --git a/make-worldconf b/make-worldconf |
14 |
index 4b962d4..85f63b0 100755 |
15 |
--- a/make-worldconf |
16 |
+++ b/make-worldconf |
17 |
@@ -66,8 +66,7 @@ def useflags(config, p): |
18 |
# Insert nicely sorted flags. |
19 |
if len(flags) > 0: |
20 |
flags.sort() |
21 |
- config[p.slot_atom]['package.use/%s' % re.sub('[/:]', '_', p.slot_atom)] = \ |
22 |
- p.slot_atom + ' ' + ' '.join(flags) |
23 |
+ config[p.slot_atom]['package.use'] = p.slot_atom + ' ' + ' '.join(flags) |
24 |
|
25 |
|
26 |
def keywords(config, p): |
27 |
@@ -84,33 +83,14 @@ def keywords(config, p): |
28 |
except AttributeError: |
29 |
pass |
30 |
if keyword: |
31 |
- config[p.slot_atom]['package.accept_keywords/%s' % re.sub('[/:]', '_', p.slot_atom)] = \ |
32 |
- '=%s %s' % (p.cpv, keyword) |
33 |
- |
34 |
- |
35 |
-def envvars(config, p): |
36 |
- fpath = os.path.join(CONST.PORTAGE_CONFIGDIR, 'package.env') |
37 |
- if os.path.isfile(fpath): |
38 |
- with open(fpath, 'r') as g: |
39 |
- for l in g.readlines(): |
40 |
- # This matching needs to be made more strick. |
41 |
- if re.search('%s' % re.escape(p.cpv_split[1]), l): |
42 |
- p_slot_atom = re.sub('[/:]', '_', p.slot_atom) |
43 |
- config[p.slot_atom]['package.env/%s' % p_slot_atom] = \ |
44 |
- '%s %s' % (p.slot_atom, p_slot_atom) |
45 |
- m = re.search('(\S+)\s+(\S+)', l) |
46 |
- env_file = os.path.join(CONST.PORTAGE_CONFIGDIR, 'env') |
47 |
- env_file = os.path.join(env_file, m.group(2)) |
48 |
- with open(env_file, 'r') as h: |
49 |
- config[p.slot_atom]['env/%s' % p_slot_atom] = h.read() |
50 |
+ config[p.slot_atom]['package.accept_keywords'] = '=%s %s' % (p.cpv, keyword) |
51 |
|
52 |
|
53 |
def others(config, p, subdir): |
54 |
- rpath = '%s/%s' % (subdir, re.sub('[/:]', '_', p.slot_atom)) |
55 |
- fpath = os.path.join(CONST.PORTAGE_CONFIGDIR, rpath) |
56 |
+ fpath = os.path.join(CONST.PORTAGE_CONFIGDIR, subdir) |
57 |
if os.path.isfile(fpath): |
58 |
with open(fpath, 'r') as g: |
59 |
- config[p.slot_atom][rpath] = g.read() |
60 |
+ config[p.slot_atom][subdir] = g.read() |
61 |
|
62 |
|
63 |
def main(): |
64 |
@@ -140,10 +120,9 @@ def main(): |
65 |
# Populate package.accept_keywords - these are read out of p |
66 |
keywords(config, p) |
67 |
|
68 |
- # Populate package.env and env/* - these are read out of /etc/portage |
69 |
- envvars(config, p) |
70 |
- |
71 |
# Others - these are read out of /etc/portage |
72 |
+ others(config, p, 'env') |
73 |
+ others(config, p, 'package.env') |
74 |
others(config, p, 'package.mask') |
75 |
others(config, p, 'package.unmask') |