Files
Archduino/internal/platform/pkgmgr.go
MDietermann 58bd532dba feat(packages): implement PlanForce to reinstall all packages
Adds Reinstall method to PackageManager and AURHelper interfaces
so modules can invoke the concrete Reinstall helpers behind the
interface. *Pacman and *Yay already satisfy it.
2026-04-14 21:55:08 +02:00

21 lines
677 B
Go

package platform
import "context"
// PackageManager abstracts OS-level package operations so later plans
// can add Debian/Fedora without touching modules.
type PackageManager interface {
Name() string
IsInstalled(ctx context.Context, pkg string) (bool, error)
Install(ctx context.Context, pkgs []string) error
Reinstall(ctx context.Context, pkgs []string) error
Update(ctx context.Context) error
}
// Runner executes a command with arguments. Injected into package managers
// so tests can stub shell-outs.
type Runner interface {
Run(ctx context.Context, name string, args ...string) error
Output(ctx context.Context, name string, args ...string) ([]byte, error)
}