From 525b609a1c88689f990d3fa30282c160dd475302 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 7 Oct 2025 12:20:48 -0500 Subject: .deb creationg is maybe working again --- argv.go | 2 +- tablePackaging.go | 38 ++++++++++++++++++++++++++++++-------- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/argv.go b/argv.go index eb976d5..b6073f1 100644 --- a/argv.go +++ b/argv.go @@ -51,7 +51,7 @@ type DebianCmd struct { DryRun bool `arg:"--dry-run" help:"only show what would be packaged"` Verbose bool `arg:"--verbose" help:"be loud about it"` Force bool `arg:"--force" help:"rebuild everything"` - Quick bool `arg:"--quick" help:"only build repos with new versions"` + All bool `arg:"--all" help:"build everything again"` } type CloneCmd struct { 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 -- cgit v1.2.3