This commit is contained in:
Jeff Carr 2025-01-07 06:47:08 -06:00
parent 56ec95f9eb
commit 0fac12c31e
1 changed files with 2 additions and 27 deletions

29
scan.go
View File

@ -3,7 +3,6 @@ package repolist
import ( import (
"fmt" "fmt"
"strconv" "strconv"
"strings"
"go.wit.com/lib/protobuf/gitpb" "go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log" "go.wit.com/log"
@ -41,23 +40,11 @@ func (r *RepoList) ScanRepositories() (int, string) {
return i, s return i, s
} }
func (r *RepoRow) NewScan() int {
return r.NewScan2()
}
func (r *RepoRow) UpdatePb(newpb *gitpb.Repo) { func (r *RepoRow) UpdatePb(newpb *gitpb.Repo) {
r.pb = newpb r.pb = newpb
} }
func (r *RepoRow) NewScan3(newpb *gitpb.Repo) int { func (r *RepoRow) NewScan() int {
if newpb.GetMasterVersion() != r.pb.GetMasterVersion() {
log.Info("THIS IS IT", newpb.GetMasterVersion(), r.pb.GetMasterVersion(), newpb.GetGoPath())
}
r.pb = newpb
return r.NewScan2()
}
func (r *RepoRow) NewScan2() int {
var changed int = 0 var changed int = 0
if r.Status == nil { if r.Status == nil {
log.Log(REPOWARN, "repo.Status = nil. not initialized for some reason") log.Log(REPOWARN, "repo.Status = nil. not initialized for some reason")
@ -79,9 +66,7 @@ func (r *RepoRow) NewScan2() int {
if r.masterVersion == nil { if r.masterVersion == nil {
panic("what the fuck node") panic("what the fuck node")
} }
if r.pb == nil {
panic("what the fuck pb")
}
r.masterVersion.SetLabel(pb.GetMasterVersion()) r.masterVersion.SetLabel(pb.GetMasterVersion())
r.develVersion.SetLabel(pb.GetDevelVersion()) r.develVersion.SetLabel(pb.GetDevelVersion())
r.userVersion.SetLabel(pb.GetUserVersion()) r.userVersion.SetLabel(pb.GetUserVersion())
@ -98,15 +83,5 @@ func (r *RepoRow) NewScan2() int {
r.Show() r.Show()
} }
// print out whatever changes have happened
if c, ok := r.Status.Changed(); ok {
log.Log(REPOWARN, "something finally changed")
c := strings.TrimSpace(c)
for _, line := range strings.Split(c, "\n") {
log.Log(REPOWARN, r.Status.Path(), line)
changed += 1
}
}
return changed return changed
} }