Documentation
¶
Overview ¶
Package repo registers extra distribution repositories (apt sources or dnf/yum repos) on the build host before any package manager operation. It supports configuration via yap.json (top-level "repos" array) and via the repeatable `--repo key=val,...` command-line flag.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Setup ¶
Setup writes apt/dnf repository definitions for every Repo applicable to the current distro. distro is the bare distro key (e.g. "ubuntu", "rocky"); only repos with empty Distros, or whose Distros entry matches, are installed. Repos that target a different package format than the active distro are silently skipped.
func SetupCrossAPT ¶
func SetupCrossAPT(opts CrossAptOptions) error
SetupCrossAPT prepares the apt configuration for cross-architecture builds. On Debian-like hosts it:
- enables the target architecture via dpkg --add-architecture;
- restricts the pre-installed sources to the build-host architecture so apt does not fetch foreign-arch indexes from archive.ubuntu.com (which only carries amd64/i386);
- registers the matching ports.ubuntu.com / deb.debian.org repository for the target arch through the standard repo.Setup pipeline; and
- refreshes the apt indexes so subsequent dependency installs resolve packages from the new repo.
The function is a no-op when the host already runs on the requested target architecture or when the distro is not Debian-based.
Types ¶
type CrossAptOptions ¶
CrossAptOptions describes the configuration required to make `apt` resolve foreign-architecture packages on the build host. Distro and codename can be left empty: when so, both are read from /etc/os-release.
type Repo ¶
type Repo struct {
Name string `json:"name"`
URL string `json:"url"`
Suite string `json:"suite,omitempty"`
Components []string `json:"components,omitempty"`
KeyURL string `json:"keyURL,omitempty"`
Distros []string `json:"distros,omitempty"`
Format string `json:"format,omitempty"`
GPGCheck bool `json:"gpgCheck,omitempty"`
}
Repo describes one additional package repository. The same structure is used for both yap.json declarations and CLI parsing. Fields that do not apply to a given format are ignored at write time.
func ParseFlags ¶
ParseFlags converts repeatable `--repo k=v,...` tokens into Repo values. Supported keys: name, url, suite, components (comma-separated subkeys are escaped with '+'), keyURL, distros (use '+'), format, gpgCheck.