Documentation
¶
Overview ¶
Package osrelease reads the systemd os-release file from a system filesystem. System-package decomposers use it to enrich package purls with the distribution's namespace and a distro= qualifier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
ID string // e.g. "fedora", "debian", "ubuntu", "alpine"
VersionID string // e.g. "38", "12", "22.04"
}
Data holds the fields of the system's os-release file we use to enrich package purls. ID feeds the purl namespace; ID + VersionID feed the distro= qualifier.
func Parse ¶
Parse parses the shell-fragment format used by os-release. Each line is KEY=VALUE; VALUE may be optionally double- or single-quoted. We only extract the keys we care about.
func Read ¶
Read reads the first os-release file found in source. A missing file is not an error — purls just get emitted without a namespace/distro.