nix-amer/internal/pkg/yum.go

28 lines
549 B
Go
Raw Permalink Normal View History

package pkg
2018-11-13 12:10:55 +00:00
import "github.com/xdrm-brackets/nix-amer/internal/exec"
type yum struct{ exec exec.Executor }
func (d *yum) SetExecutor(_exec exec.Executor) {
d.exec = _exec
}
func (d yum) Name() string { return "yum" }
func (d yum) Fetch() error {
return nil
}
func (d yum) Upgrade() error {
return d.exec.Command(d.Name(), "update").Run()
}
func (d yum) Install(_pkg string) error {
return d.exec.Command(d.Name(), "install", _pkg).Run()
}
func (d yum) Remove(_pkg string) error {
return d.exec.Command(d.Name(), "remove", _pkg).Run()
}