summaryrefslogtreecommitdiff
path: root/findNext.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-30 01:15:00 -0600
committerJeff Carr <[email protected]>2025-01-30 01:15:00 -0600
commitffb90cd28f4e166af5e7fc00d34a0b38516ddb21 (patch)
tree219882980a57ae01dd8bd6a4bc6017079b50e6a0 /findNext.go
parentf690c1a8a328d1b136af728538c418849391e572 (diff)
this process is annoying
Diffstat (limited to 'findNext.go')
-rw-r--r--findNext.go71
1 files changed, 52 insertions, 19 deletions
diff --git a/findNext.go b/findNext.go
index d307343..f7e7927 100644
--- a/findNext.go
+++ b/findNext.go
@@ -3,6 +3,7 @@ package main
import (
"fmt"
+ "slices"
"go.wit.com/log"
@@ -85,22 +86,39 @@ func findNext() bool {
continue
}
- if err := me.forge.CleanGoDepsCheckOk(check); err != nil {
- log.Info("CleanGoDepsCheckOk() failed", check.GetGoPath(), err)
- log.Info("CleanGoDepsCheckOk() failed", check.GetGoPath(), err)
- continue
- }
+ /*
+ if err := me.forge.CleanGoDepsCheckOk(check); err != nil {
+ log.Info("CleanGoDepsCheckOk() failed", check.GetGoPath(), err)
+ log.Info("CleanGoDepsCheckOk() failed", check.GetGoPath(), err)
+ continue
+ }
+ */
- if err := checkDeps(check); err != nil {
- log.Info("\t", check.GetGoPath(), err)
- continue
- } else {
- log.Info("Might be ok?", check.GetGoPath())
- }
+ /*
+ if err := checkDeps(check); err != nil {
+ log.Info("CHECK DEPS FAILED", check.GetGoPath(), err)
+ log.Info("CHECK DEPS FAILED", check.GetGoPath(), err)
+ log.Info("CHECK DEPS FAILED", check.GetGoPath(), err)
+ continue
+ } else {
+ log.Info("Might be ok?", check.GetGoPath())
+ }
+ */
+ fixGodeps(check)
+ /*
+ } else {
+ log.Info("SKIPPING FIX", check.GetGoPath())
+ log.Info("SKIPPING FIX", check.GetGoPath())
+ log.Info("SKIPPING FIX", check.GetGoPath())
+ }
+ */
if err := me.forge.FinalGoDepsCheckOk(check, argv.Verbose); err != nil {
+ // if err := me.forge.FinalGoDepsCheckOk(check, false); err != nil {
log.Info("FinalGoDepsCheckOk() repo=", check.GetGoPath(), "err:", err)
log.Info("FinalGoDepsCheckOk() repo=", check.GetGoPath(), "err:", err)
+ log.Info("CHECKING END:", check.GetGoPath())
+ log.Info("")
continue
}
log.Info("GOOD TO GO ON", check.GetGoPath())
@@ -110,10 +128,10 @@ func findNext() bool {
if findCounter == 0 {
log.Info("NOTHING TO UPDATE. findCounter =", findCounter)
} else {
- findFix = true
log.Info("me.current is nil findCounter =", findCounter, "so set findFix =", findFix)
}
log.Info("tried to findNext() but not sure what to do next counter =", findCounter, "findFix =", findFix)
+ setCurrentRepo(nil, "findNext found nothing", "crap")
me.release.status.SetText("ALL DONE?")
return false
}
@@ -127,16 +145,24 @@ func fixGodeps(check *gitpb.Repo) bool {
check.GoDeps = nil
- if _, err := check.RunVerboseOnError([]string{"go-mod-clean", "--strict"}); err != nil {
- log.Info("fixGoDeps() runGoClean() strict failed", check.GetGoPath(), err)
- log.Info("fixGoDeps() runGoClean() strict failed", check.GetGoPath(), err)
- log.Info("fixGoDeps() runGoClean() strict failed", check.GetGoPath(), err)
+ if result, err := check.RunStrictNew([]string{"go-mod-clean", "--strict"}); err != nil {
+ // log.Info("fixGoDeps() runGoClean() strict failed", check.GetGoPath(), err)
+ // log.Info("fixGoDeps() runGoClean() strict failed", check.GetGoPath(), len(result.Stdout), len(result.Stderr))
+ if len(result.Stderr) > 0 {
+ slices.Reverse(result.Stderr)
+ log.Info("fixGoDeps() runGoClean() strict failed", check.GetGoPath(), result.Stderr[0])
+ }
+ if len(result.Stdout) > 0 {
+ slices.Reverse(result.Stdout)
+ log.Info("fixGoDeps() runGoClean() strict failed", check.GetGoPath(), result.Stdout[0])
+ }
+ // log.Info("fixGoDeps() runGoClean() strict failed", check.GetGoPath())
return false
}
if check.ParseGoSum() {
return true
} else {
- log.Info("ParseGoSum() failed", check.GetGoPath())
+ log.Info("ParseGoSum() failed but go-mod-clean --strict worked", check.GetGoPath())
return false
}
// skip primative ones
@@ -178,12 +204,19 @@ func fixGodeps(check *gitpb.Repo) bool {
}
func setCurrentRepo(check *gitpb.Repo, s string, note string) bool {
- me.release.repo.SetText(check.GetGoPath())
+ if check == nil {
+ me.release.repo.SetText("")
+ me.release.version.SetText("")
+ me.release.releaseVersionB.SetText("nope")
+ } else {
+ me.release.repo.SetText(check.GetGoPath())
+ me.release.version.SetText(check.GetTargetVersion())
+ me.release.releaseVersionB.SetText("release version " + check.GetTargetVersion())
+ }
me.release.status.SetText(s)
me.release.notes.SetText(note)
me.current = check
me.release.version.SetText(check.GetTargetVersion())
- me.release.releaseVersionB.SetText("release version " + check.GetTargetVersion())
me.release.openrepo.Enable()
return true