2018-11-07 10:35:04 +00:00
|
|
|
package pkg
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os/exec"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Eopkg struct{}
|
|
|
|
|
|
|
|
func (d Eopkg) Name() string { return "eopkg" }
|
|
|
|
|
2018-11-08 11:52:14 +00:00
|
|
|
func (d Eopkg) Fetch() error {
|
|
|
|
return nil
|
2018-11-07 10:35:04 +00:00
|
|
|
}
|
|
|
|
|
2018-11-08 11:52:14 +00:00
|
|
|
func (d Eopkg) Upgrade() error {
|
|
|
|
err := exec.Command(d.Name(), "upgrade").Run()
|
2018-11-07 10:35:04 +00:00
|
|
|
exec.Command(d.Name(), "remove-orphans").Run()
|
2018-11-08 11:52:14 +00:00
|
|
|
return err
|
2018-11-07 10:35:04 +00:00
|
|
|
}
|
|
|
|
|
2018-11-08 11:52:14 +00:00
|
|
|
func (d Eopkg) Install(_pkg string) error {
|
|
|
|
err := exec.Command(d.Name(), "install", _pkg).Run()
|
|
|
|
return err
|
2018-11-07 10:35:04 +00:00
|
|
|
}
|
|
|
|
|
2018-11-08 11:52:14 +00:00
|
|
|
func (d Eopkg) Remove(_pkg string) error {
|
|
|
|
err := exec.Command(d.Name(), "remove", _pkg).Run()
|
2018-11-07 10:35:04 +00:00
|
|
|
exec.Command(d.Name(), "remove-orphans").Run()
|
2018-11-08 11:52:14 +00:00
|
|
|
return err
|
2018-11-07 10:35:04 +00:00
|
|
|
}
|