1 |
Author: zmedico |
2 |
Date: 2009-04-30 07:13:29 +0000 (Thu, 30 Apr 2009) |
3 |
New Revision: 13506 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.6/man/portage.5 |
7 |
main/branches/2.1.6/pym/portage/__init__.py |
8 |
main/branches/2.1.6/pym/portage/dbapi/porttree.py |
9 |
Log: |
10 |
Add support in repos.conf to override the "masters" setting from layout.conf. |
11 |
(trunk r13350) |
12 |
|
13 |
Modified: main/branches/2.1.6/man/portage.5 |
14 |
=================================================================== |
15 |
--- main/branches/2.1.6/man/portage.5 2009-04-30 07:13:20 UTC (rev 13505) |
16 |
+++ main/branches/2.1.6/man/portage.5 2009-04-30 07:13:29 UTC (rev 13506) |
17 |
@@ -551,8 +551,9 @@ |
18 |
Specifies \fIsite\-specific\fR repository configuration information. Note that |
19 |
configuration settings which are specified here do not apply to tools |
20 |
such as \fBrepoman\fR(1) and \fBegencache\fR(1) since their operations |
21 |
-are inherently \fBnot\fR \fIsite\-specific\fR. Beware that use of |
22 |
-\fBeclass\-overrides\fR is generally not recommended and that it may trigger |
23 |
+are inherently \fBnot\fR \fIsite\-specific\fR. \fBWARNING:\fR Use of |
24 |
+\fBrepos.conf\fR is generally not recommended since resulting changes in |
25 |
+eclass inheritance (especially due ot \fBeclass\-overrides\fR) may trigger |
26 |
performance issues under some circumstances (see \fBbug #124041\fR). |
27 |
|
28 |
.I Example: |
29 |
@@ -566,6 +567,10 @@ |
30 |
# disable all eclass overrides for ebuilds from the gentoo repository |
31 |
[gentoo] |
32 |
eclass\-overrides = |
33 |
+ |
34 |
+# override the metadata/layout.conf masters setting from the kde-testing repo |
35 |
+[kde-testing] |
36 |
+masters = gentoo kde |
37 |
.fi |
38 |
.RE |
39 |
.TP |
40 |
@@ -578,7 +583,9 @@ |
41 |
repositories which satisfy dependencies on eclasses and/or ebuilds. Each |
42 |
repository name should correspond the value of a \fBrepo_name\fR entry |
43 |
from one of the repositories that is configured via the \fBPORTDIR\fR or |
44 |
-\fBPORTDIR_OVERLAY\fR variables (see \fBmake.conf\fR(5)). |
45 |
+\fBPORTDIR_OVERLAY\fR variables (see \fBmake.conf\fR(5)). Site-specific |
46 |
+overrides to \fBlayout.conf\fR settings may be specified in |
47 |
+\fB/etc/portage/repos.conf\fR. |
48 |
|
49 |
.I Example: |
50 |
.nf |
51 |
|
52 |
Modified: main/branches/2.1.6/pym/portage/__init__.py |
53 |
=================================================================== |
54 |
--- main/branches/2.1.6/pym/portage/__init__.py 2009-04-30 07:13:20 UTC (rev 13505) |
55 |
+++ main/branches/2.1.6/pym/portage/__init__.py 2009-04-30 07:13:29 UTC (rev 13506) |
56 |
@@ -1001,12 +1001,20 @@ |
57 |
return regex |
58 |
|
59 |
class _local_repo_config(object): |
60 |
- __slots__ = ('eclass_overrides', 'name',) |
61 |
+ __slots__ = ('eclass_overrides', 'masters', 'name',) |
62 |
def __init__(self, name, repo_opts): |
63 |
self.name = name |
64 |
- self.eclass_overrides = \ |
65 |
- tuple(repo_opts.get('eclass-overrides', '').split()) |
66 |
|
67 |
+ eclass_overrides = repo_opts.get('eclass-overrides') |
68 |
+ if eclass_overrides is not None: |
69 |
+ eclass_overrides = tuple(eclass_overrides.split()) |
70 |
+ self.eclass_overrides = eclass_overrides |
71 |
+ |
72 |
+ masters = repo_opts.get('masters') |
73 |
+ if masters is not None: |
74 |
+ masters = tuple(masters.split()) |
75 |
+ self.masters = masters |
76 |
+ |
77 |
class config(object): |
78 |
""" |
79 |
This class encompasses the main portage configuration. Data is pulled from |
80 |
|
81 |
Modified: main/branches/2.1.6/pym/portage/dbapi/porttree.py |
82 |
=================================================================== |
83 |
--- main/branches/2.1.6/pym/portage/dbapi/porttree.py 2009-04-30 07:13:20 UTC (rev 13505) |
84 |
+++ main/branches/2.1.6/pym/portage/dbapi/porttree.py 2009-04-30 07:13:29 UTC (rev 13506) |
85 |
@@ -207,11 +207,27 @@ |
86 |
continue |
87 |
|
88 |
repo_name = self._repository_map.get(path) |
89 |
+ |
90 |
+ loc_repo_conf = None |
91 |
+ if local_repo_configs is not None: |
92 |
+ if repo_name is not None: |
93 |
+ loc_repo_conf = local_repo_configs.get(repo_name) |
94 |
+ else: |
95 |
+ loc_repo_conf = default_loc_repo_config |
96 |
+ |
97 |
layout_filename = os.path.join(path, "metadata/layout.conf") |
98 |
layout_file = KeyValuePairFileLoader(layout_filename, None, None) |
99 |
layout_data, layout_errors = layout_file.load() |
100 |
porttrees = [] |
101 |
- for master_name in layout_data.get('masters', '').split(): |
102 |
+ |
103 |
+ masters = None |
104 |
+ if loc_repo_conf is not None and \ |
105 |
+ loc_repo_conf.masters is not None: |
106 |
+ masters = loc_repo_conf.masters |
107 |
+ else: |
108 |
+ masters = layout_data.get('masters', '').split() |
109 |
+ |
110 |
+ for master_name in masters: |
111 |
master_path = self.treemap.get(master_name) |
112 |
if master_path is None: |
113 |
writemsg_level(("Unavailable repository '%s' " + \ |
114 |
@@ -230,13 +246,8 @@ |
115 |
|
116 |
porttrees.append(path) |
117 |
|
118 |
- if local_repo_configs is not None: |
119 |
- loc_repo_conf = None |
120 |
- if repo_name is not None: |
121 |
- loc_repo_conf = local_repo_configs.get(repo_name) |
122 |
- if loc_repo_conf is None: |
123 |
- loc_repo_conf = default_loc_repo_config |
124 |
- if loc_repo_conf is not None: |
125 |
+ if loc_repo_conf is not None and \ |
126 |
+ loc_repo_conf.eclass_overrides is not None: |
127 |
for other_name in loc_repo_conf.eclass_overrides: |
128 |
other_path = self.treemap.get(other_name) |
129 |
if other_path is None: |