diff options
Diffstat (limited to 'tablePackaging.go')
| -rw-r--r-- | tablePackaging.go | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/tablePackaging.go b/tablePackaging.go index 497a9d9..0da43b1 100644 --- a/tablePackaging.go +++ b/tablePackaging.go @@ -38,39 +38,29 @@ func getDebFilename(repo *gitpb.Repo) string { return "" } -func shouldBuild(repo *gitpb.Repo) string { - if repo.IsDirty() { - return "no" - } - ver := repo.GetCurrentVersion() - debname := getDebFilename(repo) - if !debian.DebFilenameMatchesVersion(debname, ver) { - return "yes" - } - if argv.All { - return "yes" - } - return "" +func printPackagingTable(pb *gitpb.Repos) { + tablePB := makePackagingTable(pb) + tablePB.PrintTable() + log.Printf("wit.packagingTable() %d repos\n", pb.Len()) } -func printPackagingTable(pb *gitpb.Repos) { +func makePackagingTable(pb *gitpb.Repos) *gitpb.ReposTable { tablePB := pb.NewTable("deb details") tablePB.NewUuid() - var col *gitpb.RepoFunc - col = tablePB.AddNamespace() - col.Width = 32 + col = tablePB.AddFullPath() + col.Width = 56 col = tablePB.AddStringFunc("RepoType", func(r *gitpb.Repo) string { return me.forge.GetRepoType(r) }) col.Width = 8 - col = tablePB.AddStringFunc("Build Version", func(r *gitpb.Repo) string { + col = tablePB.AddStringFunc("new .deb Version", func(r *gitpb.Repo) string { return me.forge.GetPackageVersion(r) }) - col.Width = 12 + col.Width = 16 /* col = tablePB.AddStringFunc("is old", func(r *gitpb.Repo) string { @@ -111,6 +101,14 @@ func printPackagingTable(pb *gitpb.Repos) { }) col.Width = 4 + col = tablePB.AddStringFunc("dirty", func(r *gitpb.Repo) string { + if r.IsDirty() { + return "yes" + } + return "" + }) + col.Width = 5 + col = tablePB.AddStringFunc("build", func(r *gitpb.Repo) string { return shouldBuild(r) }) @@ -128,6 +126,5 @@ func printPackagingTable(pb *gitpb.Repos) { }) col.Width = -1 - tablePB.PrintTable() - log.Printf("wit.packagingTable() %d repos\n", pb.Len()) + return tablePB } |
