From 63c5def07f3724c813a8be75977c62c2f6dfc4c8 Mon Sep 17 00:00:00 2001 From: stephen mcquay Date: Sat, 3 Mar 2018 22:24:37 -0800 Subject: [PATCH] stub out fake installs of available packages --- pkg/install.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/install.go b/pkg/install.go index 6ca39bc..a0dae41 100644 --- a/pkg/install.go +++ b/pkg/install.go @@ -1,10 +1,25 @@ package pkg import ( + "log" + "github.com/pkg/errors" + "mcquay.me/pm/db" ) // Install fetches and installs pkgs from appropriate remotes. func Install(root string, pkgs []string) error { + 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) + } return errors.New("NYI") }