summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-14 07:11:55 -0500
committerJeff Carr <[email protected]>2025-10-14 07:11:55 -0500
commitd7be78aeaa1bcb8186233f5f8807d5d0c2a5dfb0 (patch)
treeb831a0b2f9d32e58020ec5e754c2b42ae6b8e87f
parent44db8e83059e1d96abbe9b1a71aabbfa59c5b71a (diff)
rename
-rw-r--r--tableSmart.go (renamed from tableMachinePackages.go)55
1 files changed, 32 insertions, 23 deletions
diff --git a/tableMachinePackages.go b/tableSmart.go
index 93208c0..64a9877 100644
--- a/tableMachinePackages.go
+++ b/tableSmart.go
@@ -3,6 +3,7 @@
package zoopb
import (
+ "go.wit.com/lib/cobol"
"go.wit.com/log"
)
@@ -58,6 +59,37 @@ func (m *Machine) makeSmartTable(pb *Packages) *PackagesTable {
})
col.Width = 1
+ col = t.AddStringFunc("DebCtime", func(p *Package) string {
+ if p.DebInfo == nil {
+ return "debinfo == nil"
+ }
+ if p.DebInfo.DebCtime != "" {
+ return p.DebInfo.DebCtime
+ }
+ if p.BuildDate != nil {
+ return "not " + cobol.Time(p.BuildDate)
+ }
+ if p.Ctime != nil {
+ return "lies " + cobol.Time(p.Ctime)
+ }
+ return ""
+ })
+ col.Width = 22
+
+ col = t.AddStringFunc("anytime", func(p *Package) string {
+ if p.DebInfo == nil {
+ return "debinfo == nil"
+ }
+ if p.BuildDate != nil {
+ return "not " + cobol.Time(p.BuildDate)
+ }
+ if p.Ctime != nil {
+ return "lies " + cobol.Time(p.Ctime)
+ }
+ return ""
+ })
+ col.Width = 22
+
col = t.AddPackage()
col.Width = 16
@@ -91,26 +123,3 @@ func (m *Machine) WillUpgrade(p *Package) bool {
}
return false
}
-
-/*
-// this means somehow this machine has a newer version than the mirrors have
-// true if the package 'p' is newer than the installed package
-func (m *Machine) MirrorsOutOfDate(p *Package) bool {
- check := m.FindInstalledByName(p.Package)
- if check == nil {
- // not installed
- return false
- }
- v1, _ := fhelp.NewDebVersion(check.Version)
- v2, _ := fhelp.NewDebVersion(p.Version)
- if v1.Equal(v2) {
- // log.Info("do nothing", v1, v2)
- return false
- }
- if v2.LessThan(v1) {
- log.Info("wow. you have a newer version on this box than the mirrors", v1, "to", v2)
- return true
- }
- return false
-}
-*/