diff options
Diffstat (limited to 'apt.go')
| -rw-r--r-- | apt.go | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -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) +} |
