remap

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package remap implements the remap rule engine for modctl. Rules are applied sequentially in position order to transform or filter archive entry paths before they are handed to the planner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidGlobError

type InvalidGlobError struct {
	Pattern string
	Err     error
}

InvalidGlobError is returned when a glob pattern in a remap rule is malformed.

func (*InvalidGlobError) Error

func (e *InvalidGlobError) Error() string

func (*InvalidGlobError) Unwrap

func (e *InvalidGlobError) Unwrap() error

type Result

type Result struct {
	// Path is the transformed destination path. Empty if Skip is true
	Path string
	// Skip is true if the entry should be excluded from the install
	Skip bool
	// SkipReason is a human-readable explanation of why the entry was
	// skipped. Empty when Skip is false. Callers that don't need the
	// reason (e.g. the planner) can ignore this field.
	SkipReason string
}

Result is the outcome of applying a remap rule set to a single path

func Apply

func Apply(rules []dbq.RemapRule, rawPath string) (Result, error)

Apply applies a slice of RemapRules (sorted by position ascending) to the given raw archive path. It returns the transformed path or a skip signal. Rules are applied sequentially; each rule sees the path as transformed by all previous rules.

Jump to

Keyboard shortcuts

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