summaryrefslogtreecommitdiff
path: root/apt.go
diff options
context:
space:
mode:
Diffstat (limited to 'apt.go')
-rw-r--r--apt.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/apt.go b/apt.go
index 1854790..357a3a1 100644
--- a/apt.go
+++ b/apt.go
@@ -4,8 +4,11 @@
package debian
import (
+ "fmt"
+
"github.com/go-cmd/cmd"
"go.wit.com/lib/fhelp"
+ "go.wit.com/lib/protobuf/zoopb"
"go.wit.com/log"
)
@@ -53,3 +56,28 @@ func AptUpdate() error {
}
return nil
}
+
+// init the installed package list
+func initPackages(me *zoopb.Machine) {
+ // Get the list of installed packages for the detected distro
+ newP, err := getPackageList(me.Distro)
+ if err != nil {
+ fmt.Println("Error:", err)
+ return
+ }
+
+ if me.Packages == nil {
+ me.Packages = new(zoopb.Packages)
+ }
+
+ // Print the installed packages and their versions
+ for pkg, version := range newP {
+ new1 := new(zoopb.Package)
+ new1.Name = pkg
+ new1.Version = version
+ me.Packages.Append(new1)
+ // log.Info("added", new1.Name, "failed")
+ }
+
+ getMemory(me)
+}