1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# SPDX-FileCopyrightText: 2021 - 2023 StorPool <support@storpool.com>
# SPDX-License-Identifier: BSD-2-Clause
"""Common definitions for the OS/distribution variant detection library."""
"""Check whether this host is running this particular OS variant."""
:
"""The name of the file to read."""
:
"""The regular expression pattern to look for in the file."""
:
"""The "ID" field in the /etc/os-release file."""
:
"""The regular expression pattern for the "VERSION_ID" os-release field."""
"""Variant-specific commands related to OS packages."""
:
"""Make the package manager fetch new data from the upstream repositories."""
:
"""Install one or more packages from the upstream repositories."""
:
"""List the currently installed packages."""
:
"""Remove a package and all its files, including configuration ones."""
:
"""Remove a package and all its files, possibly leaving configuration ones."""
:
"""Remove a package using the low-level OS package manager."""
"""Variant-specific commands related to OS package files."""
:
"""List the packages that the one in the specified package file depends on."""
:
"""Install a package from a locally-fetched file."""
"""Variant-specific commands, mainly related to the packaging system."""
:
"""Commands related to installing packages from upstream repositories."""
:
"""Commands related to installing packages from locally-fetched files."""
"""Debian package repository data."""
:
"""The distribution codename (e.g. "buster")."""
:
"""The distribution vendor ("debian", "ubuntu", etc.)."""
:
"""The APT sources list file to copy to /etc/apt/sources.list.d/."""
:
"""The GnuPG keyring file to copy to /usr/share/keyrings/."""
:
"""OS packages that need to be installed before `apt-get update` is run."""
"""Yum/DNF package repository data."""
:
"""The *.repo file to copy to /etc/yum.repos.d/."""
:
"""The keyring file to copy to /etc/pki/rpm-gpg/."""
"""StorPool builder data."""
:
"""The builder name."""
:
"""The base Docker image that the builder is generated from."""
:
"""The branch used by the sp-pkg tool to specify the variant."""
:
"""The base kernel OS package."""
:
"""The name of the locale to use for clean UTF-8 output."""
"""The aspects of the StorPool operation supported for this build variant."""
:
"""Is there a StorPool third-party packages repository?"""
"""The information about a Linux distribution version (build variant)."""
:
"""The name of the variant, e.g. `ALMA9`, `UBUNTU2204`, etc."""
:
"""The human-readable description of the variant."""
:
"""The name of the variant that this one is based on."""
:
"""The OS "family" that this distribution belongs to."""
:
"""The ways to check whether we are running this variant."""
:
"""The aspects of StorPool operation supported for this build variant."""
:
"""The OS commands to execute for particular purposes."""
:
"""The minimum Python version that we can depend on."""
: |
"""The StorPool repository files to install."""
:
"""The names of the packages to be used for this variant."""
:
"""The name of the directory to install systemd unit files to."""
:
"""The filename extension of the OS packages ("deb", "rpm", etc.)."""
:
"""The type of initramfs-generating tools."""
:
"""The data specific to the StorPool builder containers."""
"""The changes to be applied to the parent variant definition."""
:
"""The name of the new variant."""
:
"""The description of the new variant."""
:
"""The variant that the new one is based on."""
:
"""The ways to detect the new variant."""
:
"""The changes to be applied to the parent variant's structure."""
"""The attributes of a currently-installed or known OS package."""
:
"""The package name."""
:
"""The package version."""
:
"""The system-dependent package architecture name."""
:
"""The system-dependent status of the package (installed, half-installed, removed, etc)."""
"""Attributes common to a StorPool package repository."""
:
"""The name of the StorPool package repository."""
:
"""The extension to be used in filenames for configurating the package manager."""
:
"""The base URL of the StorPool package repository."""
: =
: =
: =
"""Base class for errors that occurred during variant processing."""
"""Invalid parameters passed to the variant routines."""
"""Runtime configuration for the sp-variant library functions."""
: | None = None
"""Additional arguments passed to the command."""
: | None = None
"""The main argument: a command to execute, a variant specification to show, etc."""
: = False
"""No-operation mode; display what would have been done."""
: | None = None
"""The path to the directory containing the `add-storpool-repo` data files to install."""
: =
"""Which StorPool repository to configure."""
: = False
"""Verbose operation; display diagnostic output."""
"""Output a diagnostic message in verbose mode."""
# noqa: T201
"""We always send the diagnostic messages to stderr now."""
return True
"""Simulate setting the property, do nothing instead."""
# OK, this is a bit ugly. It's going away soon.
# noqa: ANN401
"""Ignore any attempts to set the `_diag_to_stderr` member."""
return
# Let us not do this ever again.
=
= # type: ignore[method-assign,assignment] # noqa: SLF001
# noqa: ANN401 # this needs to operate on, well, anything
"""Return a more readable representation of an object."""
return
return
return
return
return