summaryrefslogtreecommitdiff
path: root/doUpgrade.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-03 04:42:47 -0500
committerJeff Carr <[email protected]>2025-10-03 04:42:47 -0500
commit26686bf8d667f71bb5b493ce4ec84f740fb8d061 (patch)
treea69d9c0cd2509653aab3d90ce7c9237f87aa35ab /doUpgrade.go
parentf4ce449e7ba5de977de8e8d100bf26dabafb97be (diff)
rill 'go install'
Diffstat (limited to 'doUpgrade.go')
-rw-r--r--doUpgrade.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/doUpgrade.go b/doUpgrade.go
index 83f69ef..3d8d0c1 100644
--- a/doUpgrade.go
+++ b/doUpgrade.go
@@ -4,7 +4,11 @@
package main
import (
+ "fmt"
+
+ "go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/zoopb"
+ "go.wit.com/log"
)
func doUpgrade() error {
@@ -20,5 +24,27 @@ func doUpgrade() error {
me.machine, _ = zoopb.InitMachine()
doAptUpgrade()
+
+ fmt.Println("Installed Packages:")
+ loop := me.machine.Wit.SortByName()
+ for loop.Scan() {
+ p := loop.Next()
+ // log.Info("apt install", p.Name)
+ if p.Name == "" {
+ log.Info("odd /var/lib/apt/ list parse error. p.Name was blank (should be the package name)", p)
+ continue
+ }
+ if !me.machine.IsInstalled(p.Name) {
+ continue
+ }
+ if argv.DryRun {
+ log.Info("should install package", p.Name)
+ }
+
+ cmd := []string{"apt", "install", p.Name}
+ log.Info("Running:", cmd)
+ shell.RunVerbose(cmd)
+ }
+ okExit("installed")
return nil
}