diff options
| author | Jeff Carr <[email protected]> | 2025-10-24 02:36:25 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-24 02:36:25 -0500 | 
| commit | d858946501f58a932521b05534c0a1717476adba (patch) | |
| tree | 7ab0bdc145220ef44306b15211d46ddae7cfe447 | |
| parent | 2ae3b613b8e1cac099eb029ad1baa18cc72bec6d (diff) | |
try to fix .deb build counter
| -rw-r--r-- | argv.custom.go | 2 | ||||
| -rw-r--r-- | doBuild.debian.go | 19 | ||||
| -rw-r--r-- | doUpgrade.go | 8 | 
3 files changed, 26 insertions, 3 deletions
diff --git a/argv.custom.go b/argv.custom.go index 25904ee..4a9a582 100644 --- a/argv.custom.go +++ b/argv.custom.go @@ -67,7 +67,7 @@ func (args) ArgvGui() error {  func (a args) DoAutoComplete(pb *argvpb.Argv) {  	base := []string{"build", "upgrade", "git", "publish", "pb", "linux", "droplet", "test"} -	base = append(base, "--version", "--force", "--all") +	base = append(base, "--version", "--force", "--all", "--dry-run")  	// add these only if installed  	if _, err := fhelp.CheckCmd("zood"); err == nil { diff --git a/doBuild.debian.go b/doBuild.debian.go index a34bc43..e8f497d 100644 --- a/doBuild.debian.go +++ b/doBuild.debian.go @@ -5,6 +5,7 @@ package main  import (  	"errors" +	"fmt"  	"os"  	"path/filepath"  	"strconv" @@ -24,33 +25,42 @@ func findBuildDeb() *gitpb.Repos {  	initForge()  	var dumbtable [][]string +	dumbtable = append(dumbtable, []string{"FullPath", "version", "reason"})  	found := gitpb.NewRepos()  	for check := range me.forge.Repos.IterAll() { +		var reason string  		if me.forge.Config.IsReadOnly(check.GetNamespace()) { +			reason = "readonly"  			continue  		}  		if me.forge.Config.IsPrivate(check.GetNamespace()) {  			if !argv.Build.Debian.Priv { +				reason = "private"  				continue  			}  		}  		if !check.IsBinary() { +			reason = "not-binary"  			// can't build packages that aren't GO binaries  			continue  		}  		if argv.Build.Debian.Arch != "" {  			if check.IsGoPlugin() { +				reason = "plugin"  				continue  			}  			// mask some packages for arch builds  			if strings.Contains(check.Namespace, "fyne") { +				reason = "plugin"  				continue  			}  			if strings.Contains(check.Namespace, "toolkit") { +				reason = "broken"  				continue  			}  			if strings.Contains(check.Namespace, "going2git") { +				reason = "broken"  				continue  			}  		} @@ -61,8 +71,15 @@ func findBuildDeb() *gitpb.Repos {  			if shouldBuild(check) == "yes" {  				// need to build  			} else { +				var version string +				bvers, err := getBuildVersion(check) +				if err == nil { +					version = check.DebianCurrentVersion(bvers) +				} else { +					version = fmt.Sprintf("err=(%v)", err) +				}  				// log.Info(check.FullPath, "not building for reasons: todo: get reason") -				dumbtable = append(dumbtable, []string{check.FullPath, "not building for reasons: todo: get reason"}) +				dumbtable = append(dumbtable, []string{check.FullPath, version, reason})  				continue  			}  		} diff --git a/doUpgrade.go b/doUpgrade.go index 81027ff..b04ce61 100644 --- a/doUpgrade.go +++ b/doUpgrade.go @@ -36,7 +36,9 @@ func doUpgrade() error {  		return nil  	} -	if !argv.DryRun { +	// if !argv.DryRun { +	// } +	if areSuperuser() {  		checkSuperuser()  		debian.AptUpdate()  		// try to re-init due to new apt lists @@ -61,6 +63,10 @@ func doUpgrade() error {  	for p := range me.machine.Wit.IterByPackage() {  		if me.machine.WillUpgrade(p) { +			if !areSuperuser() { +				log.Info("Would install here but you are not root") +				continue +			}  			if argv.DryRun {  				log.Info("Would install here without --dry-run")  				continue  | 
