diff options
| author | Jeff Carr <[email protected]> | 2025-10-04 18:24:54 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-04 18:24:54 -0500 |
| commit | 11ee0bb0d2e3b3eb5169de880c4eaeb6f36987c9 (patch) | |
| tree | d7b8f66fe41f85a2d4e27b923fd6d7d1a7fe9a27 /doUpgrade.go | |
| parent | 88cf5058f1162249b9d95b6c36628b20960550ba (diff) | |
more debuggingv0.1.8
Diffstat (limited to 'doUpgrade.go')
| -rw-r--r-- | doUpgrade.go | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/doUpgrade.go b/doUpgrade.go index ee8e7f3..7fb3f88 100644 --- a/doUpgrade.go +++ b/doUpgrade.go @@ -10,15 +10,40 @@ import ( "go.wit.com/log" ) +func doPackageList(all bool) { + installed := zoopb.NewPackages() + for p := range me.machine.Wit.IterAll() { + found := me.machine.FindInstalledByName(p.Name) + if found == nil { + continue + } + p.Installed = true + installed.Append(p) + } + if all { + me.machine.Wit.PrintTable() + } else { + installed.PrintTable() + } +} + func doUpgrade() error { + me.machine, _ = zoopb.InitMachine() + + if argv.Upgrade.List != nil { + if argv.Upgrade.All { + doPackageList(true) + } else { + doPackageList(false) + } + return nil + } + if !argv.DryRun { checkSuperuser() - aptUpdate() } - me.machine, _ = zoopb.InitMachine() - var installed []string fmt.Println("Installed Packages:") |
