diff options
Diffstat (limited to 'doBuild.go')
| -rw-r--r-- | doBuild.go | 46 |
1 files changed, 45 insertions, 1 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) |
