Expand description
Linux distribution identity and the package names that follow from it.
The same knowledge — “what is this distro, and what is this dependency
called on it” — was previously spelled out in five places: an /etc/os-release
substring match in the CLI, another in the llama.cpp build checker, four
near-identical match blocks turning dependency names into apt/dnf/pacman/
zypper packages, and twenty hardcoded apt install install hints that were
simply wrong anywhere else. Keeping five copies in step by hand is what let
them drift.
Everything here is pure. parse_os_release takes the file’s contents
rather than reading them, so this stays in the domain layer with no I/O, and
the parser can be tested against real files from distributions no CI machine
is running.
Structs§
- Package
Names - What one dependency is called on each family.
Enums§
- Linux
Distro - Distribution family, which is what package names actually key off.
Constants§
- PACKAGES 🔒
- Dependency name → package names, keyed by the names used in
SystemProbePort::check_all_dependencies.
Functions§
- family_
of 🔒 - Map a single os-release identifier to its family.
- install_
hint - A ready-to-run install command for one dependency, e.g.
pacman -S libayatana-appindicator. - packages_
for - Package names for a dependency.
- parse_
os_ release - Identify the distribution family from the contents of
/etc/os-release. - unquote 🔒
- Strip the optional quoting os-release allows around values.