diff options
| author | Jeff Carr <[email protected]> | 2025-10-04 18:24:54 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-04 18:24:54 -0500 | 
| commit | 11ee0bb0d2e3b3eb5169de880c4eaeb6f36987c9 (patch) | |
| tree | d7b8f66fe41f85a2d4e27b923fd6d7d1a7fe9a27 | |
| parent | 88cf5058f1162249b9d95b6c36628b20960550ba (diff) | |
more debuggingv0.1.8
| -rw-r--r-- | argv.go | 6 | ||||
| -rw-r--r-- | doDebian.go | 13 | ||||
| -rw-r--r-- | doUpgrade.go | 31 | 
3 files changed, 44 insertions, 6 deletions
@@ -62,8 +62,10 @@ type CloneCmd struct {  }  type UpgradeCmd struct { -	DryRun bool `arg:"--dry-run"                     help:"don't really do anything"` -	Force  bool `arg:"--force"                       help:"force un-install and re-install each package"` +	List   *EmptyCmd `arg:"subcommand:list"               help:"fix urls from the repomap"` +	All    bool      `arg:"--all"                         help:"show all the packages"` +	DryRun bool      `arg:"--dry-run"                     help:"don't really do anything"` +	Force  bool      `arg:"--force"                       help:"force un-install and re-install each package"`  }  type DefaultCmd struct { diff --git a/doDebian.go b/doDebian.go index 34861f0..52753ca 100644 --- a/doDebian.go +++ b/doDebian.go @@ -149,13 +149,24 @@ func shouldBuild(repo *gitpb.Repo) bool {  	return false  } +// avoids nil panics +func isDebianRelease() bool { +	if argv.Build == nil { +		return false +	} +	if argv.Build.Debian == nil { +		return false +	} +	return argv.Build.Debian.Release +} +  func buildDeb(check *gitpb.Repo) error {  	var cmd []string  	outdir := getOutdir(check)  	os.MkdirAll(outdir, 0755) -	if argv.Build.Debian.Release { +	if isDebianRelease() {  		cmd = []string{"go-deb", "--release", "--namespace", check.Namespace, "--dir", outdir}  	} else {  		cmd = []string{"go-deb", "--namespace", check.Namespace, "--dir", outdir} diff --git a/doUpgrade.go b/doUpgrade.go index ee8e7f3..7fb3f88 100644 --- a/doUpgrade.go +++ b/doUpgrade.go @@ -10,15 +10,40 @@ import (  	"go.wit.com/log"  ) +func doPackageList(all bool) { +	installed := zoopb.NewPackages() +	for p := range me.machine.Wit.IterAll() { +		found := me.machine.FindInstalledByName(p.Name) +		if found == nil { +			continue +		} +		p.Installed = true +		installed.Append(p) +	} +	if all { +		me.machine.Wit.PrintTable() +	} else { +		installed.PrintTable() +	} +} +  func doUpgrade() error { +	me.machine, _ = zoopb.InitMachine() + +	if argv.Upgrade.List != nil { +		if argv.Upgrade.All { +			doPackageList(true) +		} else { +			doPackageList(false) +		} +		return nil +	} +  	if !argv.DryRun {  		checkSuperuser() -  		aptUpdate()  	} -	me.machine, _ = zoopb.InitMachine() -  	var installed []string  	fmt.Println("Installed Packages:")  | 
