Gentoo Archives: gentoo-catalyst

From: Felix Bier <Felix.Bier@×××××××××××××.com>
To: "gentoo-catalyst@l.g.o" <gentoo-catalyst@l.g.o>
Subject: [gentoo-catalyst] [PATCH 2/5] Rename config option 'portage_overlay' -> 'repos'
Date: Thu, 04 Feb 2021 00:35:59
Message-Id: 3b390728d68d34123b63a956b3180704cb79d1e2.camel@rohde-schwarz.com
1 This commit renames the config option 'portage_overlay' to 'repos'.
2 Also, it renames the method 'portage_overlay' to 'process_repos'
3 and 'set_portage_overlay' to 'set_repos'. Motivation:
4
5 1) The Gentoo wiki states 'repository' as the preferred term,
6 and 'overlay' only as a colloquial
7 (https://wiki.gentoo.org/wiki/Ebuild_repository),
8 reducing the distinction between the main repository
9 and other 'overlay' repositories.
10
11 3) This avoids confusion with filesystem overlays
12 (via the config option 'overlay' and 'root_overlay').
13
14 2) The plural form highlights the possibility of specifying
15 multiple repositories, continuing 2861038a.
16
17 Signed-off-by: Felix Bier <felix.bier@×××××××××××××.com>
18 ---
19 catalyst/base/stagebase.py | 30 ++++++++++++++--------------
20 catalyst/targets/livecd_stage2.py | 2 +-
21 catalyst/targets/stage1.py | 6 +++---
22 catalyst/targets/stage2.py | 6 +++---
23 catalyst/targets/stage3.py | 6 +++---
24 catalyst/targets/stage4.py | 2 +-
25 doc/catalyst-config.5.txt | 2 +-
26 doc/catalyst-spec.5.txt | 2 +-
27 examples/generic_stage_template.spec | 4 ++--
28 examples/livecd-stage1_template.spec | 4 ++--
29 examples/livecd-stage2_template.spec | 4 ++--
30 examples/netboot_template.spec | 4 ++--
31 examples/stage4_template.spec | 4 ++--
32 13 files changed, 38 insertions(+), 38 deletions(-)
33
34 diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
35 index 46cb1fda..fedc8f87 100644
36 --- a/catalyst/base/stagebase.py
37 +++ b/catalyst/base/stagebase.py
38 @@ -81,14 +81,14 @@ class StageBase(TargetBase, ClearBase, GenBase):
39 "ldflags",
40 "pkgcache_path",
41 "portage_confdir",
42 - "portage_overlay",
43 + "repos",
44 "portage_prefix",
45 ])
46 self.prepare_sequence = [
47 self.unpack,
48 self.config_profile_link,
49 self.setup_confdir,
50 - self.portage_overlay,
51 + self.process_repos,
52 ]
53 self.build_sequence = [
54 self.bind,
55 @@ -206,7 +206,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
56 self.set_linuxrc()
57 self.set_busybox_config()
58 self.set_overlay()
59 - self.set_portage_overlay()
60 + self.set_repos()
61 self.set_root_overlay()
62
63 # This next line checks to make sure that the specified variables exist on disk.
64 @@ -586,13 +586,13 @@ class StageBase(TargetBase, ClearBase, GenBase):
65 del self.settings[self.settings["spec_prefix"] +
66 "/busybox_config"]
67
68 - def set_portage_overlay(self):
69 - if "portage_overlay" in self.settings:
70 - if isinstance(self.settings['portage_overlay'], str):
71 - self.settings["portage_overlay"] = \
72 - self.settings["portage_overlay"].split()
73 - log.info('portage_overlay directories are set to: %s',
74 - ' '.join(self.settings['portage_overlay']))
75 + def set_repos(self):
76 + if 'repos' in self.settings:
77 + if isinstance(self.settings['repos'], str):
78 + self.settings['repos'] = \
79 + self.settings['repos'].split()
80 + log.info('repos directories are set to: %s',
81 + ' '.join(self.settings['repos']))
82
83 def set_overlay(self):
84 if self.settings["spec_prefix"] + "/overlay" in self.settings:
85 @@ -831,10 +831,10 @@ class StageBase(TargetBase, ClearBase, GenBase):
86 except OSError as e:
87 raise CatalystError(f'Could not write {repo_conf_chroot}: {e}') from e
88
89 - def portage_overlay(self):
90 + def process_repos(self):
91 """ We copy the contents of our repos to get_repo_location(repo_name) """
92 - if "portage_overlay" in self.settings:
93 - for x in self.settings["portage_overlay"]:
94 + if 'repos' in self.settings:
95 + for x in self.settings['repos']:
96 if os.path.exists(x):
97 name = get_repo_name(x)
98
99 @@ -1145,8 +1145,8 @@ class StageBase(TargetBase, ClearBase, GenBase):
100 clear_path(target)
101
102 # Remove our overlays
103 - if "portage_overlay" in self.settings:
104 - for repo_path in self.settings["portage_overlay"]:
105 + if 'repos' in self.settings:
106 + for repo_path in self.settings['repos']:
107 repo_name = get_repo_name(repo_path)
108
109 repo_conf = self.get_repo_conf_path(repo_name)
110 diff --git a/catalyst/targets/livecd_stage2.py b/catalyst/targets/livecd_stage2.py
111 index ff4ea62a..774702f8 100644
112 --- a/catalyst/targets/livecd_stage2.py
113 +++ b/catalyst/targets/livecd_stage2.py
114 @@ -42,7 +42,7 @@ class livecd_stage2(StageBase):
115 "livecd/xdm",
116 "livecd/xinitrc",
117 "livecd/xsession",
118 - "portage_overlay",
119 + "repos",
120 ])
121
122 def __init__(self, spec, addlargs):
123 diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py
124 index 5a154e76..0ea5f92b 100644
125 --- a/catalyst/targets/stage1.py
126 +++ b/catalyst/targets/stage1.py
127 @@ -66,9 +66,9 @@ class stage1(StageBase):
128 if "ldflags" in self.settings:
129 self.settings["LDFLAGS"] = self.settings["ldflags"]
130
131 - def set_portage_overlay(self):
132 - StageBase.set_portage_overlay(self)
133 - if "portage_overlay" in self.settings:
134 + def set_repos(self):
135 + StageBase.set_repos(self)
136 + if "repos" in self.settings:
137 log.warning(
138 'Using an overlay for earlier stages could cause build issues.\n'
139 "If you break it, you buy it. Don't complain to us about it.\n"
140 diff --git a/catalyst/targets/stage2.py b/catalyst/targets/stage2.py
141 index 0b7244e3..786f1020 100644
142 --- a/catalyst/targets/stage2.py
143 +++ b/catalyst/targets/stage2.py
144 @@ -39,9 +39,9 @@ class stage2(StageBase):
145 if "ldflags" in self.settings:
146 self.settings["LDFLAGS"] = self.settings["ldflags"]
147
148 - def set_portage_overlay(self):
149 - StageBase.set_portage_overlay(self)
150 - if "portage_overlay" in self.settings:
151 + def set_repos(self):
152 + StageBase.set_repos(self)
153 + if "repos" in self.settings:
154 log.warning(
155 'Using an overlay for earlier stages could cause build issues.\n'
156 "If you break it, you buy it. Don't complain to us about it.\n"
157 diff --git a/catalyst/targets/stage3.py b/catalyst/targets/stage3.py
158 index cfc0dbf9..d20ed679 100644
159 --- a/catalyst/targets/stage3.py
160 +++ b/catalyst/targets/stage3.py
161 @@ -17,9 +17,9 @@ class stage3(StageBase):
162 def __init__(self, spec, addlargs):
163 StageBase.__init__(self, spec, addlargs)
164
165 - def set_portage_overlay(self):
166 - StageBase.set_portage_overlay(self)
167 - if "portage_overlay" in self.settings:
168 + def set_repos(self):
169 + StageBase.set_repos(self)
170 + if "repos" in self.settings:
171 log.warning(
172 'Using an overlay for earlier stages could cause build issues.\n'
173 "If you break it, you buy it. Don't complain to us about it.\n"
174 diff --git a/catalyst/targets/stage4.py b/catalyst/targets/stage4.py
175 index f8383f75..ff1d4dca 100644
176 --- a/catalyst/targets/stage4.py
177 +++ b/catalyst/targets/stage4.py
178 @@ -15,7 +15,7 @@ class stage4(StageBase):
179 ])
180 valid_values = required_values | frozenset([
181 "boot/kernel",
182 - "portage_overlay",
183 + "repos",
184 "stage4/empty",
185 "stage4/fsscript",
186 "stage4/gk_mainargs",
187 diff --git a/doc/catalyst-config.5.txt b/doc/catalyst-config.5.txt
188 index ebd99b55..003d40b6 100644
189 --- a/doc/catalyst-config.5.txt
190 +++ b/doc/catalyst-config.5.txt
191 @@ -115,7 +115,7 @@ Defaults to `${storedir}/repos`.
192
193 *repo_basedir*::
194 The target repository directory to contain the primary repo (e.g.,
195 -gentoo repo) and any overlays. The default location is
196 +gentoo repo) and any other repos. The default location is
197 `/var/db/repos`.
198
199 *repo_name*::
200 diff --git a/doc/catalyst-spec.5.txt b/doc/catalyst-spec.5.txt
201 index 4c1df857..10eb0bb8 100644
202 --- a/doc/catalyst-spec.5.txt
203 +++ b/doc/catalyst-spec.5.txt
204 @@ -80,7 +80,7 @@ This is an optional directory containing portage configuration files
205 `/etc/portage` and should be consistent across all targets to minimize
206 problems.
207
208 -*portage_overlay*::
209 +*repos*::
210 This option specifies the location of the ebuild repositories that you would
211 like to have used when building this target. It takes a space-separated list
212 of directory names. (example: `/usr/local/portage`).
213 diff --git a/examples/generic_stage_template.spec b/examples/generic_stage_template.spec
214 index 8c8889bf..9d91d07d 100644
215 --- a/examples/generic_stage_template.spec
216 +++ b/examples/generic_stage_template.spec
217 @@ -93,8 +93,8 @@ portage_confdir:
218 # like to have used when building this target. It takes a space-separated list
219 # of directory names.
220 # example:
221 -# portage_overlay: /usr/local/portage
222 -portage_overlay:
223 +# repos: /usr/local/portage
224 +repos:
225
226 # This allows the optional directory containing the output packages for
227 # catalyst. Mainly used as a way for different spec files to access the same
228 diff --git a/examples/livecd-stage1_template.spec b/examples/livecd-stage1_template.spec
229 index 269a1e3d..b9edb87d 100644
230 --- a/examples/livecd-stage1_template.spec
231 +++ b/examples/livecd-stage1_template.spec
232 @@ -56,8 +56,8 @@ portage_confdir:
233 # like to have used when building this target. It takes a space-separated list
234 # of directory names.
235 # example:
236 -# portage_overlay: /usr/local/portage
237 -portage_overlay:
238 +# repos: /usr/local/portage
239 +repos:
240
241 # This allows the optional directory containing the output packages for
242 # catalyst. Mainly used as a way for different spec files to access the same
243 diff --git a/examples/livecd-stage2_template.spec b/examples/livecd-stage2_template.spec
244 index 4f50919f..8db17ed7 100644
245 --- a/examples/livecd-stage2_template.spec
246 +++ b/examples/livecd-stage2_template.spec
247 @@ -56,8 +56,8 @@ portage_confdir:
248 # like to have used when building this target. It takes a space-separated list
249 # of directory names.
250 # example:
251 -# portage_overlay: /usr/local/portage
252 -portage_overlay:
253 +# repos: /usr/local/portage
254 +repos:
255
256 # This allows the optional directory containing the output packages for
257 # catalyst. Mainly used as a way for different spec files to access the same
258 diff --git a/examples/netboot_template.spec b/examples/netboot_template.spec
259 index ad9d993c..07b3b53f 100644
260 --- a/examples/netboot_template.spec
261 +++ b/examples/netboot_template.spec
262 @@ -10,8 +10,8 @@ source_subpath: default/stage3-mips-uclibc-mips3-2006.126
263 # like to have used when building this target. It takes a space-separated list
264 # of directory names.
265 # example:
266 -# portage_overlay: /usr/local/portage
267 -portage_overlay:
268 +# repos: /usr/local/portage
269 +repos:
270
271 boot/kernel: ip22r4k ip22r5k ip27r10k ip28r10k ip30r10k ip32r5k
272 boot/kernel/ip22r4k/sources: =mips-sources-2.6.14.5
273 diff --git a/examples/stage4_template.spec b/examples/stage4_template.spec
274 index aea70e86..5fbf6a50 100644
275 --- a/examples/stage4_template.spec
276 +++ b/examples/stage4_template.spec
277 @@ -56,8 +56,8 @@ portage_confdir:
278 # like to have used when building this target. It takes a space-separated list
279 # of directory names.
280 # example:
281 -# portage_overlay: /usr/local/portage
282 -portage_overlay:
283 +# repos: /usr/local/portage
284 +repos:
285
286 # This allows the optional directory containing the output packages for
287 # catalyst. Mainly used as a way for different spec files to access the same
288 --
289 2.30.0