summaryrefslogtreecommitdiff
path: root/tablePackaging.go
diff options
context:
space:
mode:
Diffstat (limited to 'tablePackaging.go')
-rw-r--r--tablePackaging.go38
1 files changed, 30 insertions, 8 deletions
diff --git a/tablePackaging.go b/tablePackaging.go
index 7c1c897..02922e2 100644
--- a/tablePackaging.go
+++ b/tablePackaging.go
@@ -4,6 +4,7 @@
package main
import (
+ "go.wit.com/lib/debian"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/lib/protobuf/zoopb"
"go.wit.com/log"
@@ -27,6 +28,16 @@ func isPackageOnMirrors(repo *gitpb.Repo) bool {
return true
}
+func getDebFilename(repo *gitpb.Repo) string {
+ name := me.forge.Config.DebName(repo.Namespace)
+ for pkg := range me.machine.Wit.IterAll() {
+ if name == pkg.Name {
+ return pkg.PkgName
+ }
+ }
+ return ""
+}
+
func printPackagingTable(pb *gitpb.Repos) {
tablePB := pb.NewTable("deb details")
tablePB.NewUuid()
@@ -73,7 +84,12 @@ func printPackagingTable(pb *gitpb.Repos) {
col.Width = 1
col = tablePB.AddStringFunc("done", func(r *gitpb.Repo) string {
- if isPackageOnMirrors(r) {
+ if r.IsDirty() {
+ return "yes"
+ }
+ ver := r.GetCurrentVersion()
+ debname := getDebFilename(r)
+ if debian.DebFilenameMatchesVersion(debname, ver) {
return "yes"
}
return ""
@@ -81,7 +97,15 @@ func printPackagingTable(pb *gitpb.Repos) {
col.Width = 4
col = tablePB.AddStringFunc("build", func(r *gitpb.Repo) string {
- if isPackageOnMirrors(r) {
+ if r.IsDirty() {
+ return "no"
+ }
+ ver := r.GetCurrentVersion()
+ debname := getDebFilename(r)
+ if !debian.DebFilenameMatchesVersion(debname, ver) {
+ return "yes"
+ }
+ if argv.All {
return "yes"
}
return ""
@@ -92,13 +116,11 @@ func printPackagingTable(pb *gitpb.Repos) {
col.Width = 32
col = tablePB.AddStringFunc("filename for .deb", func(r *gitpb.Repo) string {
- name := me.forge.Config.DebName(r.Namespace)
- for pkg := range me.machine.Wit.IterAll() {
- if name == pkg.Name {
- return pkg.PkgName
- }
+ debname := getDebFilename(r)
+ if debname == "" {
+ return "missing " + debname
}
- return "missing " + name
+ return debname
})
col.Width = -1