summaryrefslogtreecommitdiff
path: root/scanGoSum.go
diff options
context:
space:
mode:
Diffstat (limited to 'scanGoSum.go')
-rw-r--r--scanGoSum.go64
1 files changed, 29 insertions, 35 deletions
diff --git a/scanGoSum.go b/scanGoSum.go
index 8701808..55890ec 100644
--- a/scanGoSum.go
+++ b/scanGoSum.go
@@ -2,61 +2,55 @@
package main
import (
+ "go.wit.com/lib/gui/repolist"
"go.wit.com/log"
)
-func (r *repo) getGoSumStatus() string {
- return r.goSumStatus.String()
+/*
+func getGoSumStatus(r *repolist.Repo) string {
+ return r.Status.GoSumStatus.String()
}
-func (r *repo) setGoSumStatus(s string) {
+func setGoSumStatus(r *repolist.Repo, s string) {
r.goSumStatus.SetLabel(s)
r.status.SetGoSumStatus(s)
}
+*/
-func (r *repo) checkDirty() bool {
- if r.status.CheckDirty() {
- log.Info("dirty repo:", r.status.String(), r.getGoSumStatus())
- r.setGoSumStatus("DIRTY")
- return true
- }
- return false
-}
-
-func (r *repo) checkSafeGoSumRemake() {
- if ok, bad := r.status.CheckSafeGoSumRemake(); ok {
+func checkSafeGoSumRemake(r *repolist.Repo) {
+ if ok, bad := r.Status.CheckSafeGoSumRemake(); ok {
log.Info("checkSafeGoSumRemake() is safe to redo")
- r.setGoSumStatus("SAFE")
- r.status.MakeRedomod()
+ r.Status.SetGoSumStatus("SAFE")
+ r.Status.MakeRedomod()
} else {
log.Info("checkSafeGoSumRemake() is not safe. problems:", bad)
- r.setGoSumStatus("BAD DEP")
+ r.Status.SetGoSumStatus("BAD DEP")
}
}
func scanGoSum() {
- for _, repo := range me.allrepos {
- if repo.String() == "go.wit.com/apps/guireleaser" {
+ for _, repo := range me.repos.View.AllRepos() {
+ if repo.GoPath() == "go.wit.com/apps/guireleaser" {
if release.guireleaser == nil {
release.guireleaser = repo
}
}
- latestversion := repo.status.GetLastTagVersion()
- if repo.getGoSumStatus() == "BAD" {
+ latestversion := repo.Status.GetLastTagVersion()
+ if repo.GoState() == "BAD" {
continue
}
- if repo.getGoSumStatus() == "DIRTY" {
+ if repo.GoState() == "DIRTY" {
continue
}
- if repo.status.CheckPrimativeGoMod() {
- log.Info("PRIMATIVE repo:", latestversion, repo.status.String())
- repo.setGoSumStatus("PRIMATIVE")
+ if repo.Status.CheckPrimativeGoMod() {
+ log.Info("PRIMATIVE repo:", latestversion, repo.GoPath())
+ repo.SetGoState("PRIMATIVE")
continue
}
- if repo.checkDirty() {
- log.Info("dirty repo:", latestversion, repo.status.String())
- log.Info("dirty repo.getGoSumStatus =", repo.getGoSumStatus())
- repo.setGoSumStatus("DIRTY")
+ if repo.CheckDirty() {
+ log.Info("dirty repo:", latestversion, repo.GoPath())
+ log.Info("dirty repo.getGoSumStatus =", repo.GoState())
+ repo.SetGoState("DIRTY")
// release.repo.SetValue(repo.status.String())
// release.status.SetValue("dirty")
@@ -65,12 +59,12 @@ func scanGoSum() {
// release.openrepo.Enable()
continue
}
- if ok, missing := repo.status.CheckGoSum(); ok {
+ if ok, missing := repo.Status.CheckGoSum(); ok {
log.Info("repo has go.sum requirements that are clean")
- repo.setGoSumStatus("CLEAN")
+ repo.SetGoState("CLEAN")
} else {
log.Info("repo has go.sum requirements that are screwed up. missing:", missing)
- repo.setGoSumStatus("BAD")
+ repo.SetGoState("BAD")
// release.repo.SetValue(repo.status.String())
// release.status.SetValue("bad")
@@ -79,14 +73,14 @@ func scanGoSum() {
// release.openrepo.Enable()
continue
}
- status := repo.dirtyLabel.String()
+ status := repo.State()
if status == "PERFECT" {
continue
} else {
- repo.newScan()
+ repo.NewScan()
}
- log.Info("repo:", latestversion, status, repo.status.String())
+ log.Info("repo:", latestversion, status, repo.GoPath())
}
log.Info("scanGoSum() did everything, not sure what to do next")
}