2018-11-07 10:35:04 +00:00
|
|
|
package pkg
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os/exec"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Apk struct{}
|
|
|
|
|
|
|
|
func (d Apk) Name() string { return "apk" }
|
|
|
|
|
2018-11-08 11:52:14 +00:00
|
|
|
func (d Apk) Fetch() error {
|
|
|
|
return exec.Command(d.Name(), "update").Run()
|
2018-11-07 10:35:04 +00:00
|
|
|
}
|
|
|
|
|
2018-11-08 11:52:14 +00:00
|
|
|
func (d Apk) Upgrade() error {
|
|
|
|
return exec.Command(d.Name(), "upgrade").Run()
|
2018-11-07 10:35:04 +00:00
|
|
|
}
|
|
|
|
|
2018-11-08 11:52:14 +00:00
|
|
|
func (d Apk) Install(_pkg string) error {
|
|
|
|
return exec.Command(d.Name(), "add", _pkg).Run()
|
2018-11-07 10:35:04 +00:00
|
|
|
}
|
|
|
|
|
2018-11-08 11:52:14 +00:00
|
|
|
func (d Apk) Remove(_pkg string) error {
|
|
|
|
return exec.Command(d.Name(), "del", _pkg).Run()
|
2018-11-07 10:35:04 +00:00
|
|
|
}
|