diff options
| author | Jeff Carr <[email protected]> | 2025-10-05 11:25:22 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-05 11:25:22 -0500 |
| commit | 47bbda6e304cb1cae8ee0a8ce5c840df8a47a5a9 (patch) | |
| tree | 7e295de2b9847e3ab940ec0495f7bea440e53642 /doUpgrade.go | |
| parent | c7b9aceb77cfea8f9a3b6d5d9c38b3d496585bcf (diff) | |
better stuff and rm pre table PB code
Diffstat (limited to 'doUpgrade.go')
| -rw-r--r-- | doUpgrade.go | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/doUpgrade.go b/doUpgrade.go index 18689d0..6fa6bdf 100644 --- a/doUpgrade.go +++ b/doUpgrade.go @@ -12,19 +12,19 @@ import ( func doPackageList(all bool) { installed := zoopb.NewPackages() - for p := range me.machine.Wit.IterAll() { - found := me.machine.FindInstalledByName(p.Name) - if found == nil { - continue + for p := range me.machine.Wit.IterByName() { + if all { + installed.Append(p) + } else { + found := me.machine.FindInstalledByName(p.Name) + if found == nil { + continue + } + p.Installed = true + installed.Append(p) } - p.Installed = true - installed.Append(p) - } - if all { - me.machine.Wit.PrintTable() - } else { - installed.PrintTable() } + installed.PrintTable() log.Info("aptly repo -remove-files -force-replace add wit /home/aptly/incoming/autogenpb_0.5.16_amd64.deb") log.Info("aptly repo remove wit basicwindow") log.Info("aptly snapshot create wit-v0.8.3 from repo wit") @@ -51,6 +51,8 @@ func doUpgrade() error { var installed []string + installable := zoopb.NewPackages() + fmt.Println("Installed Packages:") loop := me.machine.Wit.SortByName() for loop.Scan() { @@ -59,6 +61,7 @@ func doUpgrade() error { log.Infof("odd /var/lib/apt/ list parse error. p.Name was blank (should be the package name) p=%v\n", p) continue } + installable.Append(p) if !me.machine.IsInstalled(p.Name) { continue } @@ -81,6 +84,8 @@ func doUpgrade() error { installed = append(installed, p.Name) } + installable.PrintTable() + me.sh.GoodExit("") if argv.Force { // force remove the packages. can be used if binaries change but versions didn't for _, pkgname := range installed { |
