28 lines
570 B
Go
28 lines
570 B
Go
package pkg
|
|
|
|
import "git.xdrm.io/go/nix-amer/internal/exec"
|
|
|
|
type apk struct{ exec exec.Executor }
|
|
|
|
func (d *apk) SetExecutor(_exec exec.Executor) {
|
|
d.exec = _exec
|
|
}
|
|
|
|
func (d apk) Name() string { return "apk" }
|
|
|
|
func (d apk) Fetch() error {
|
|
return d.exec.Command(d.Name(), "update").Run()
|
|
}
|
|
|
|
func (d apk) Upgrade() error {
|
|
return d.exec.Command(d.Name(), "upgrade").Run()
|
|
}
|
|
|
|
func (d apk) Install(_pkg string) error {
|
|
return d.exec.Command(d.Name(), "add", _pkg).Run()
|
|
}
|
|
|
|
func (d apk) Remove(_pkg string) error {
|
|
return d.exec.Command(d.Name(), "del", _pkg).Run()
|
|
}
|