Documentation
¶
Overview ¶
Package localrepo provides utilities for managing local RPM repositories.
Index ¶
Constants ¶
const (
// CreaterepoCBinary is the name of the createrepo_c executable.
CreaterepoCBinary = "createrepo_c"
)
Variables ¶
This section is empty.
Functions ¶
func RequireCreaterepoC ¶
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 ¶
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 ¶
EnsureRepoExists ensures the repository directory exists, creating it if necessary.
func (*Publisher) EnsureRepoInitialized ¶
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 ¶
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.