diff options
| author | Jeff Carr <[email protected]> | 2025-10-07 12:49:17 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-07 12:49:17 -0500 | 
| commit | 9cea97eba7242d179c997999b2fac957912e5cd1 (patch) | |
| tree | 1c30b9040d9272f24b33260c38a34b023d36962b | |
| parent | 525b609a1c88689f990d3fa30282c160dd475302 (diff) | |
maybe it'll build and publish and make .debsv0.1.21
| -rw-r--r-- | doDebian.go | 15 | ||||
| -rw-r--r-- | doPublish.go | 10 | ||||
| -rw-r--r-- | tablePackaging.go | 28 | 
3 files changed, 26 insertions, 27 deletions
diff --git a/doDebian.go b/doDebian.go index e78bbf0..bedb691 100644 --- a/doDebian.go +++ b/doDebian.go @@ -39,7 +39,9 @@ func doBuildDeb() error {  			continue  		} -		found.Append(check) +		if shouldBuild(check) == "yes" { +			found.Append(check) +		}  	}  	printPackagingTable(found) @@ -77,24 +79,17 @@ func buildDeb(check *gitpb.Repo) error {  	} else {  		cmd = []string{"go-deb", "--namespace", check.Namespace, "--dir", outdir}  	} +  	if me.forge.Config.IsPrivate(check.GetNamespace()) {  		cmd = []string{"go-deb", "--namespace", check.Namespace, "--dir", outdir}  		return nil  	} -	if argv.Verbose || argv.Force { +	if argv.Verbose {  		// log.Info("build cmd:", cmd)  		cmd = append(cmd, "--verbose")  	} -	if argv.Force { -		// skip checks -	} else { -		if isPackageOnMirrors(check) { -			return nil -		} -	} -  	if argv.DryRun {  		log.Info("RUN:", check.FullPath, cmd)  		return nil diff --git a/doPublish.go b/doPublish.go index 6c2c790..3b57214 100644 --- a/doPublish.go +++ b/doPublish.go @@ -6,6 +6,7 @@ package main  import (  	"fmt"  	"os" +	"time"  	"go.wit.com/lib/fhelp"  	"go.wit.com/lib/gui/shell" @@ -37,16 +38,15 @@ func doPublish() error {  		me.sh.BadExit("merge failed", nil)  	} -	if argv.Force { -		cmd = []string{"forge", "--force", "merge", "check"} -	} else { -		cmd = []string{"forge", "merge", "check"} -	} +	cmd = []string{"forge", "merge", "check"}  	if _, err := shell.RunRealtimeError(cmd); err != nil {  		if _, err := shell.RunVerbose(cmd); err != nil {  			me.sh.BadExit("merge failed", nil)  		}  	} +	// todo: os.Stat() file +	time.Sleep(time.Second) +	me.forge.Repos.Load()  	if err := doInstall(); err != nil {  		log.Info("doInstall() failed", err) diff --git a/tablePackaging.go b/tablePackaging.go index 02922e2..497a9d9 100644 --- a/tablePackaging.go +++ b/tablePackaging.go @@ -38,6 +38,21 @@ 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 := pb.NewTable("deb details")  	tablePB.NewUuid() @@ -97,18 +112,7 @@ func printPackagingTable(pb *gitpb.Repos) {  	col.Width = 4  	col = tablePB.AddStringFunc("build", func(r *gitpb.Repo) string { -		if r.IsDirty() { -			return "no" -		} -		ver := r.GetCurrentVersion() -		debname := getDebFilename(r) -		if !debian.DebFilenameMatchesVersion(debname, ver) { -			return "yes" -		} -		if argv.All { -			return "yes" -		} -		return "" +		return shouldBuild(r)  	})  	col.Width = 5  | 
