diff options
| author | Jeff Carr <[email protected]> | 2025-10-26 12:35:18 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-26 12:35:18 -0500 |
| commit | 45ffdae423f5d73579d933806436b1105c96a5e5 (patch) | |
| tree | 51badb626cab50dabcdafd372800852233a0a570 | |
| parent | 274f92129eb5acfde2d5acc8aeead584acf64ff4 (diff) | |
try new code out
| -rw-r--r-- | doBuild.go | 46 | ||||
| -rw-r--r-- | resources/go-deb | 2 |
2 files changed, 46 insertions, 2 deletions
@@ -9,6 +9,7 @@ import ( "path/filepath" "strings" + "go.wit.com/lib/cobol" "go.wit.com/lib/protobuf/argvpb" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" @@ -39,10 +40,19 @@ func doBuild() (string, error) { if err != nil { return "missing resources/go-deb list", err } + var simpletable [][]string + simpletable = append(simpletable, []string{"debname", "version", " age", "smartver", "curb", "curver", "newb", "arch", "FullPath"}) for i, line := range strings.Split(string(data), "\n") { var path string var debname string var arches string + line = strings.TrimSpace(line) + if line == "" { + continue + } + if strings.HasPrefix(line, "#") { + continue + } parts := strings.Split(line, ",") if len(parts) > 0 { path = parts[0] @@ -53,9 +63,43 @@ func doBuild() (string, error) { if len(parts) > 2 { arches = parts[2] } - log.Info("MAKE DEB FOR:", i, path, debname, arches) + repo := me.forge.Repos.FindByNamespace(path) + if repo == nil { + log.Info("CAN NOT FIND REPO FOR:", i, path, debname, arches) + continue + } + if debname == "" { + _, debname = filepath.Split(path) + } + p := me.machine.Wit.FindByPackage(debname) + if p == nil { + log.Info("CAN NOT FIND PACKAGE FOR:", debname) + continue + } + // var version string + // version = actualp.GetVersion() + + // log.Info("MAKE DEB FOR:", i, path, debname, arches) + bcount := fmt.Sprintf("%d", p.GetBuildCount()) + var newcount string + smartver := p.GetSmartVersion() + curver := repo.GetCurrentVersion() + if smartver == curver { + newcount = fmt.Sprintf("%d", p.GetBuildCount()+1) + } else { + newcount = fmt.Sprintf("%d", 0) + } + var age string + if t := p.GetAge(); t == nil { + age = "notsure" + } else { + age = cobol.Duration(t) + } + simpletable = append(simpletable, []string{debname, p.Version, age, p.GetSmartVersion(), bcount, curver, newcount, arches, repo.FullPath}) } + footer := cobol.SimpleTable(simpletable) + log.Info("simple build table footer:", footer) /* if err := doInstall(found); err != nil { // log.Info("doInstall() failed", err) diff --git a/resources/go-deb b/resources/go-deb index c38c67a..5fb3adb 100644 --- a/resources/go-deb +++ b/resources/go-deb @@ -15,7 +15,7 @@ go.wit.com/apps/utils/mirrors,mirrors.wit.com go.wit.com/apps/utils/powerpaneld go.wit.com/apps/utils/startxplacement go.wit.com/apps/utils/virtigoctl -go.wit.com/apps/utils/wit +go.wit.com/apps/utils/wit,wit-tools go.wit.com/apps/virtigo go.wit.com/apps/zookeeper,zookeeper-go, go.wit.com/lib/daemons/gus |
