summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-04 02:26:06 -0600
committerJeff Carr <[email protected]>2024-12-04 02:26:06 -0600
commit37a3c9622788b9710d82b638f091a6a5fccfc474 (patch)
tree47d4073bb1ce58505895a01e9e2865b6a502c182
parent1c18f171c1bc9f6de5f7ce3d781e342ee85fe62c (diff)
need to fix this stillv0.0.16
-rw-r--r--apt_linux.go41
1 files changed, 41 insertions, 0 deletions
diff --git a/apt_linux.go b/apt_linux.go
index 3e71d1a..540908b 100644
--- a/apt_linux.go
+++ b/apt_linux.go
@@ -70,3 +70,44 @@ func dpkgQuery() (map[string]string, error) {
// Return the map with package names and versions
return installedPackages, scanner.Err()
}
+
+func (me *Machine) UpdatePackages() string {
+ log.Info("fixme. broken after move to autogenpb")
+ return ""
+}
+/*
+func (me *Machine) UpdatePackages() string {
+ // Get the list of installed packages for the detected distro
+ newP, err := getPackageList(me.Distro)
+ if err != nil {
+ fmt.Println("Error:", err)
+ return fmt.Sprintln("getPackageList()", err)
+ }
+
+ var newCounter, changeCounter int
+ // Print the installed packages and their versions
+ for pkg, version := range newP {
+ found := me.Packages.FindByName(pkg)
+ if found == nil {
+ log.Info("adding new", pkg, version)
+ me.addNew(pkg, version)
+ newCounter += 1
+ } else {
+ found.Version = version
+ panic("redo this. broken after autogenpb. was never right anyway")
+ //if me.Packages.Update(found) {
+ // changeCounter += 1
+ //}
+ }
+ }
+
+ footer := fmt.Sprintf("%s has distro %s with %d packages installed", me.Hostname, me.Distro, me.Packages.Len())
+ if changeCounter != 0 {
+ footer += fmt.Sprintf(" (%d changed)", changeCounter)
+ }
+ if newCounter != 0 {
+ footer += fmt.Sprintf(" (%d new)", newCounter)
+ }
+ return footer
+}
+*/