repocompare

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package repocompare loads and compares RPM repository package inventories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	// Fetch returns the bytes at rawURL.
	Fetch(ctx context.Context, rawURL string, disableSSLVerify bool) ([]byte, error)
}

Fetcher retrieves repository metadata.

type HTTPFetcher

type HTTPFetcher struct {
	Attempts int
}

HTTPFetcher retrieves repository metadata over HTTP with bounded retries.

func (*HTTPFetcher) Fetch

func (f *HTTPFetcher) Fetch(ctx context.Context, rawURL string, disableSSLVerify bool) ([]byte, error)

Fetch implements Fetcher.

type Package

type Package struct {
	Name    string
	Epoch   string
	Version string
	Release string
	Arch    string
	Kind    projectconfig.SubrepoKind
}

Package identifies one package in RPM primary metadata.

func LoadRepositories

func LoadRepositories(
	ctx context.Context,
	fetcher Fetcher,
	repositories []Repository,
) ([]Package, error)

LoadRepositories snapshots each repository's repomd document before loading its primary metadata.

func (Package) EVR

func (p Package) EVR() string

EVR returns the package's epoch, version, and release without its architecture.

func (Package) Identity

func (p Package) Identity() string

Identity returns the stable key used to compare package inventories.

func (Package) NEVR

func (p Package) NEVR() string

NEVR returns the package's human-readable name, epoch, version, and release.

func (Package) NEVRA

func (p Package) NEVRA() string

NEVRA returns the package's human-readable name, epoch, version, release, and architecture.

type PackageReport

type PackageReport struct {
	Name       string `json:"name"       table:"Name"`
	Summary    string `json:"summary"    table:"Summary"`
	LeftNEVRs  string `json:"leftNevrs"  table:"Left NEVRs"`
	RightNEVRs string `json:"rightNevrs" table:"Right NEVRs"`
}

PackageReport summarizes both inventories for one differing package name.

func Compare

func Compare(left, right []Package) ([]PackageReport, error)

Compare returns one package-centric report for each package name with inventory differences.

type PackageStatus

type PackageStatus string

PackageStatus summarizes why a package name appears in the comparison.

const (
	// PackageStatusMissingFromRight indicates that the left contains an identity absent from the right.
	PackageStatusMissingFromRight PackageStatus = "missing-from-right"
	// PackageStatusAddedInRight indicates that the right contains an identity absent from the left.
	PackageStatusAddedInRight PackageStatus = "added-in-right"
	// PackageStatusArchitecturesDiffer indicates that matching NEVRs have different architecture sets.
	PackageStatusArchitecturesDiffer PackageStatus = "architectures-differ"
)

type Repository

type Repository struct {
	ID               string
	Kind             projectconfig.SubrepoKind
	URL              string
	DisableSSLVerify bool
}

Repository describes one physical RPM repository.

Jump to

Keyboard shortcuts

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