Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion mkosi/distribution/debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,15 @@ def package_manager(cls, config: Config) -> type[Apt]:
@classmethod
def repositories(cls, context: Context, for_image: bool = False) -> Iterable[AptRepository]:
types = ("deb", "deb-src")
components = ("main", *context.config.repositories)
components = ("main", *[s for s in context.config.repositories if ":" not in s])
suite_components = {}
for s in [s for s in context.config.repositories if ":" in s]:
key, value = s.split(":", 1)
if key not in suite_components:
suite_components[key] = [value]
else:
suite_components[key].append(value)

mirror = None if for_image else context.config.mirror
snapshot = None if for_image else context.config.snapshot

Expand Down Expand Up @@ -77,6 +85,19 @@ def repositories(cls, context: Context, for_image: bool = False) -> Iterable[Apt
signedby=signedby,
)

for suite, comps in suite_components.items():
if snapshot:
url = join_mirror(mirror, f"archive/{suite}/{snapshot}")
else:
url = join_mirror(mirror, "debian")
yield AptRepository(
types=types,
url=url,
suite=suite,
components=tuple(comps),
signedby=signedby,
)

# Debug repos are typically not mirrored.
if snapshot:
url = join_mirror(mirror, f"archive/debian-debug/{snapshot}")
Expand Down
3 changes: 2 additions & 1 deletion mkosi/resources/man/mkosi.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,8 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`,

`Repositories=`, `--repositories=`
: Enable package repositories that are disabled by default. This can be used to enable the EPEL repos for
CentOS or different components of the Debian/Kali/Ubuntu repositories.
CentOS or different components of the Debian/Kali/Ubuntu repositories. Debian suites can be specified
ahead of the component, separated by a ":" (colon) character, e.g. `trixie-backports:main`.

### [Output] Section

Expand Down