summaryrefslogtreecommitdiff
path: root/apt.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-15 21:05:03 -0600
committerJeff Carr <[email protected]>2024-11-15 21:05:03 -0600
commit8193bf18abbef3ffb00d22820899096db19ba428 (patch)
tree064f4c63d6e621bac395d586d4ff5c78d2d27a25 /apt.go
parent706b0418bf68a09ff7b78a1646c280a53be68c97 (diff)
move to just sending machine
Diffstat (limited to 'apt.go')
-rw-r--r--apt.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/apt.go b/apt.go
index 9f88164..de38135 100644
--- a/apt.go
+++ b/apt.go
@@ -21,21 +21,21 @@ func initPackages() {
new1 := new(zoopb.Package)
new1.Name = pkg
new1.Version = version
- if me.packages.Append(new1) {
+ if me.machine.Packages.Append(new1) {
// log.Info("added", new1.Name, "ok")
} else {
log.Info("added", new1.Name, "failed")
}
}
- log.Info(me.hostname, "has distro", me.distro, "with", me.packages.Len(), "packages installed")
+ log.Info(me.hostname, "has distro", me.distro, "with", me.machine.Packages.Len(), "packages installed")
}
func addNew(name string, version string) bool {
new1 := new(zoopb.Package)
new1.Name = name
new1.Version = version
- return me.packages.Append(new1)
+ return me.machine.Packages.Append(new1)
}
func updatePackages() {
@@ -49,20 +49,20 @@ func updatePackages() {
var newCounter, changeCounter int
// Print the installed packages and their versions
for pkg, version := range newP {
- found := me.packages.FindByName(pkg)
+ found := me.machine.Packages.FindByName(pkg)
if found == nil {
log.Info("adding new", pkg, version)
addNew(pkg, version)
newCounter += 1
} else {
found.Version = version
- if me.packages.Update(found) {
+ if me.machine.Packages.Update(found) {
changeCounter += 1
}
}
}
- footer := fmt.Sprintf("%s has distro %s with %d packages installed", me.hostname, me.distro, me.packages.Len())
+ footer := fmt.Sprintf("%s has distro %s with %d packages installed", me.hostname, me.distro, me.machine.Packages.Len())
if changeCounter != 0 {
footer += fmt.Sprintf(" (%d changed)", changeCounter)
}