26 lines
420 B
Go
26 lines
420 B
Go
package pkg
|
|
|
|
import (
|
|
"os/exec"
|
|
)
|
|
|
|
type Yum struct{}
|
|
|
|
func (d Yum) Name() string { return "yum" }
|
|
|
|
func (d Yum) Fetch() error {
|
|
return nil
|
|
}
|
|
|
|
func (d Yum) Upgrade() error {
|
|
return exec.Command(d.Name(), "update").Run()
|
|
}
|
|
|
|
func (d Yum) Install(_pkg string) error {
|
|
return exec.Command(d.Name(), "install", _pkg).Run()
|
|
}
|
|
|
|
func (d Yum) Remove(_pkg string) error {
|
|
return exec.Command(d.Name(), "remove", _pkg).Run()
|
|
}
|