overrides

package
v0.0.0-...-8e3b5be Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package overrides applies the factory's local recipe-override patches to a pantry checkout, in pure Go — no `git apply` (or any other CLI) shell-out.

An override is a plain `git diff` against the pantry root (paths of the form projects/<project>/package.yml): a candidate fix for a genuine upstream-recipe bug that the factory validates locally before it is proposed upstream to pkgxdev/pantry — the override file *is* the future pull request.

Application is idempotent: every file a patch touches is first reset to its committed state, so a re-run against a persistent clone (the local repro harness mounts one) applies as cleanly as a fresh CI clone. A patch that no longer applies (upstream moved) is skipped loudly, never fatally — the recipe then simply falls back to upstream as-is.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Dir  string       // directory holding the *.patch overrides
	Root string       // pantry checkout to patch (a git worktree)
	Log  func(string) // progress lines (applied patches); optional
	Warn func(string) // problem lines (skipped patches); optional
}

Options configures Apply.

type Result

type Result struct {
	Applied []string
	Skipped []string
}

Result reports the outcome, patch basenames in application order.

func Apply

func Apply(o Options) (Result, error)

Apply applies every Dir/*.patch to the pantry checkout at Root, in sorted (deterministic) order. It returns an error only when the override directory itself cannot be enumerated; individual patches that fail to parse or apply are reported through Warn and counted in Result.Skipped.

Jump to

Keyboard shortcuts

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