localrepo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package localrepo provides utilities for managing local RPM repositories.

Index

Constants

View Source
const (
	// CreaterepoCBinary is the name of the createrepo_c executable.
	CreaterepoCBinary = "createrepo_c"
)

Variables

This section is empty.

Functions

func RequireCreaterepoC

func RequireCreaterepoC(ctx opctx.Ctx) error

RequireCreaterepoC checks that createrepo_c is available, offering to install it if not.

Types

type Publisher

type Publisher struct {
	// contains filtered or unexported fields
}

Publisher handles publishing RPMs to a local repository.

func NewPublisher

func NewPublisher(
	ctx opctx.Ctx,
	repoPath string,
	initialize bool,
) (*Publisher, error)

NewPublisher creates a new Publisher for the given repository path. The path is converted to an absolute path to ensure consistent behavior regardless of working directory changes during command execution.

If initialize is true, the repository will be initialized with metadata (via createrepo_c) so it can be used as a dependency source. This requires createrepo_c to be available and will check for it.

func (*Publisher) EnsureRepoExists

func (p *Publisher) EnsureRepoExists() error

EnsureRepoExists ensures the repository directory exists, creating it if necessary.

func (*Publisher) EnsureRepoInitialized

func (p *Publisher) EnsureRepoInitialized(ctx context.Context) error

EnsureRepoInitialized ensures the repository directory exists and has valid repo metadata. This is required before the repo can be used as a dependency source (e.g., via mock --addrepo).

func (*Publisher) PublishRPMs

func (p *Publisher) PublishRPMs(ctx context.Context, rpmPaths []string) error

PublishRPMs copies the given RPM files to the repository and updates the repository metadata. If an RPM file is already in the repository directory, the copy is skipped.

func (*Publisher) RepoPath

func (p *Publisher) RepoPath() string

RepoPath returns the absolute path to the repository.

Jump to

Keyboard shortcuts

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