dnfpins

package
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package dnfpins queries AlmaLinux 10 repodata over HTTP and updates package pins across Dockerfiles and .goreleaser.yaml.

Index

Constants

View Source
const (
	AlmaLinuxBaseURL      = "https://repo.almalinux.org/almalinux/10"
	AnsibleDockerfilePath = "containers/ansible/Dockerfile"
	UbiDockerfilePath     = "containers/ubi/Dockerfile"
	GoreleaserConfigPath  = ".goreleaser.yaml"
)

The AlmaLinux 10 repository and the files whose pins are rewritten from it.

Variables

This section is empty.

Functions

func RpmCompareValues

func RpmCompareValues(a, b string) int

RpmCompareValues implements the RPM segment comparison algorithm (rpmvercmp).

func UpdateDockerfileAnsiblePins

func UpdateDockerfileAnsiblePins(path, ansibleVer, bashVer string) error

UpdateDockerfileAnsiblePins updates the ARG lines in containers/ansible/Dockerfile.

func UpdateDockerfileUbiPins

func UpdateDockerfileUbiPins(path, shadowVer, bashVer string) error

UpdateDockerfileUbiPins updates the ARG lines in containers/ubi/Dockerfile.

func UpdateGoreleaserDnfPins

func UpdateGoreleaserDnfPins(path string, pins *AlmaLinuxPins) error

UpdateGoreleaserDnfPins updates build_args in .goreleaser.yaml for both cargoship-ubi and cargoship-ansible.

Types

type AlmaLinuxPins

type AlmaLinuxPins struct {
	AnsibleCore    string
	BashCompletion string
	ShadowUtils    string
}

AlmaLinuxPins holds the newest version of each package the containers pin.

func QueryLatestAlmaLinuxPackages

func QueryLatestAlmaLinuxPackages(ctx context.Context) (*AlmaLinuxPins, error)

QueryLatestAlmaLinuxPackages finds latest versions of ansible-core, bash-completion, and shadow-utils.

type PrimaryXML

type PrimaryXML struct {
	XMLName  xml.Name     `xml:"metadata"`
	Packages []RpmPackage `xml:"package"`
}

PrimaryXML represents metadata xml packages.

func FetchPrimaryXML

func FetchPrimaryXML(ctx context.Context, client *http.Client, repo string) (*PrimaryXML, error)

FetchPrimaryXML fetches and decodes the primary.xml.gz from a given repository component.

type RepomdDataElem

type RepomdDataElem struct {
	Type     string         `xml:"type,attr"`
	Location RepomdLocation `xml:"location"`
}

RepomdDataElem is one <data> element of a repomd.xml index.

type RepomdLocation

type RepomdLocation struct {
	Href string `xml:"href,attr"`
}

RepomdLocation is a location href, relative to the repository root.

type RepomdXML

type RepomdXML struct {
	XMLName xml.Name         `xml:"repomd"`
	Data    []RepomdDataElem `xml:"data"`
}

RepomdXML models the top-level repodata/repomd.xml index.

type RpmPackage

type RpmPackage struct {
	Name     string         `xml:"name"`
	Arch     string         `xml:"arch"`
	Version  RpmVersion     `xml:"version"`
	Checksum string         `xml:"checksum"`
	Location RepomdLocation `xml:"location"`
}

RpmPackage is one <package> entry of a primary.xml document.

func FindLatestRPM

func FindLatestRPM(primary *PrimaryXML, pkgName string) (*RpmPackage, error)

FindLatestRPM searches PrimaryXML for the newest version of pkgName.

type RpmVersion

type RpmVersion struct {
	Epoch string `xml:"epoch,attr"`
	Ver   string `xml:"ver,attr"`
	Rel   string `xml:"rel,attr"`
}

RpmVersion is an RPM epoch-version-release triple, as primary.xml spells it.

func (RpmVersion) Compare

func (v RpmVersion) Compare(other RpmVersion) int

Compare compares RpmVersion to other using standard RPM EVR comparison semantics. Returns -1 if v < other, 0 if v == other, 1 if v > other.

func (RpmVersion) FullVersion

func (v RpmVersion) FullVersion() string

FullVersion returns the version-release representation used for package specification: "<ver>-<rel>".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL