diff options
| author | Jeff Carr <[email protected]> | 2024-12-03 18:03:42 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-03 18:03:42 -0600 |
| commit | a58234f82cad50c0fd6739a1bab968d660777a38 (patch) | |
| tree | dd454c55426e522e39ae3af3041470081074085a /goDebCheck.go | |
| parent | 5d5f69157050117af2a6f0b850a885fefa55c7ae (diff) | |
renamev0.0.20
Diffstat (limited to 'goDebCheck.go')
| -rw-r--r-- | goDebCheck.go | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/goDebCheck.go b/goDebCheck.go deleted file mode 100644 index b07bb7c..0000000 --- a/goDebCheck.go +++ /dev/null @@ -1,84 +0,0 @@ -package forgepb - -import ( - "strings" - - "go.wit.com/lib/protobuf/gitpb" - "go.wit.com/log" -) - -// this is a final check to make sure, before pushing -// a golang repo, that the go.sum file has the correct -// and current version of every package -// -// it re-scans the go.sum file. DOES NOT MODIFY ANYTHING -// this is the last thing to run to double check everything -// before 'git tag' or git push --tags -func (f *Forge) FinalGoDepsCheckOk(check *gitpb.Repo) bool { - var good bool = true - if check == nil { - log.Info("boo, check == nil") - return false - } - // clear out the protobuf and rescan from the file - check.GoDeps = nil - if ok, err := check.ParseGoSum(); !ok { - log.Info("FinalGoDepsCheckOk() error", err) - return false - } - - if check.GoDepsLen() == 0 { - // this is a primitive - check.GoPrimitive = true - return true - } - - log.Printf("current repo %s go dependancy count: %d", check.GetGoPath(), check.GoDepsLen()) - deps := check.GoDeps.SortByGoPath() - for deps.Scan() { - depRepo := deps.Next() - found := f.Repos.FindByGoPath(depRepo.GetGoPath()) - if found == nil { - if f.checkOverride(depRepo.GetGoPath()) { - // skip this gopath because it's probably broken forever - continue - } - log.Info("not found:", depRepo.GetGoPath()) - good = false - continue - } - // log.Info("found dep", depRepo.GetGoPath()) - if depRepo.GetVersion() != found.GetTargetVersion() { - check := f.Repos.FindByGoPath(depRepo.GoPath) - if f.IsReadOnly(check) { - log.Printf("%-48s ok error .%s. vs .%s. (ignoring read-only repo)", depRepo.GetGoPath(), depRepo.GetVersion(), found.GetTargetVersion()) - } else { - if f.checkOverride(depRepo.GetGoPath()) { - log.Printf("%-48s ok error .%s. vs .%s. (forge.checkOverride())", depRepo.GetGoPath(), depRepo.GetVersion(), found.GetTargetVersion()) - // skip this gopath because it's probably broken forever - continue - } else { - log.Printf("%-48s error %10s vs %10s", depRepo.GetGoPath(), depRepo.GetVersion(), found.GetTargetVersion()) - good = false - } - } - } - } - return good -} - -func (f *Forge) checkOverride(gopath string) bool { - if gopath == "cloud.google.com/go" { - log.Info("checkOverride() is ignoring", gopath) - return false - } - if strings.HasPrefix(gopath, "github.com/go-gl") { - log.Info("checkOverride() is ignoring", gopath) - return false - } - if gopath == "github.com/posener/complete/v2" { - log.Info("checkOverride() is ignoring", gopath) - return false - } - return false -} |
