2018-03-03 21:28:24 -08:00
|
|
|
package pkg
|
|
|
|
|
|
|
|
import (
|
2018-03-03 22:24:37 -08:00
|
|
|
"log"
|
|
|
|
|
2018-03-03 21:28:24 -08:00
|
|
|
"github.com/pkg/errors"
|
2018-03-03 22:24:37 -08:00
|
|
|
"mcquay.me/pm/db"
|
2018-03-03 21:28:24 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
// Install fetches and installs pkgs from appropriate remotes.
|
|
|
|
func Install(root string, pkgs []string) error {
|
2018-03-03 22:24:37 -08:00
|
|
|
av, err := db.LoadAvailable(root)
|
|
|
|
if err != nil {
|
|
|
|
return errors.Wrap(err, "loading available db")
|
|
|
|
}
|
|
|
|
|
|
|
|
ms, err := av.Installable(pkgs)
|
|
|
|
if err != nil {
|
|
|
|
return errors.Wrap(err, "checking ability to install")
|
|
|
|
}
|
|
|
|
for _, m := range ms {
|
|
|
|
log.Printf("fake install %v", m)
|
|
|
|
}
|
2018-03-03 21:28:24 -08:00
|
|
|
return errors.New("NYI")
|
|
|
|
}
|