feat(module): add PlanForce to Module interface with stubs
This commit is contained in:
@@ -49,6 +49,12 @@ type Module interface {
|
||||
Meta() Meta
|
||||
Detect(ctx context.Context) (State, error)
|
||||
Plan(ctx context.Context, current State) (Plan, error)
|
||||
// PlanForce returns a plan that reapplies the module unconditionally,
|
||||
// ignoring current detected state. Used by `archduino install --force`.
|
||||
// Implementations should produce a plan equivalent to a from-scratch
|
||||
// install — reinstall packages without pacman's --needed guard and
|
||||
// rewrite managed config files.
|
||||
PlanForce(ctx context.Context) (Plan, error)
|
||||
Apply(ctx context.Context, plan Plan, r Reporter) error
|
||||
Verify(ctx context.Context) error
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ type fakeModule struct {
|
||||
func (f fakeModule) Meta() Meta { return Meta{ID: f.id, Name: f.id, Deps: f.deps} }
|
||||
func (f fakeModule) Detect(context.Context) (State, error) { return nil, nil }
|
||||
func (f fakeModule) Plan(context.Context, State) (Plan, error) { return Plan{}, nil }
|
||||
func (f fakeModule) PlanForce(context.Context) (Plan, error) { return Plan{}, nil }
|
||||
func (f fakeModule) Apply(context.Context, Plan, Reporter) error { return nil }
|
||||
func (f fakeModule) Verify(context.Context) error { return nil }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user