summaryrefslogtreecommitdiff
path: root/cleanGoSum.go
diff options
context:
space:
mode:
Diffstat (limited to 'cleanGoSum.go')
-rw-r--r--cleanGoSum.go31
1 files changed, 20 insertions, 11 deletions
diff --git a/cleanGoSum.go b/cleanGoSum.go
index 85abac7..8d416e2 100644
--- a/cleanGoSum.go
+++ b/cleanGoSum.go
@@ -8,6 +8,7 @@ import (
"sort"
"strings"
+ "go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
@@ -18,8 +19,8 @@ import (
// checks to see if every 'master' git branch version
// matches the go.sum file
func cleanGoDepsCheckOk(check *gitpb.Repo) error {
- var err error = nil
- var fixes [][]string
+ // var err error = nil
+ // var fixes [][]string
log.Printf("current repo %s go dependancy count: %d", check.GetGoPath(), check.GoDepsLen())
if check.GoDeps == nil {
return errors.New("check.GoDeps == nil")
@@ -34,8 +35,7 @@ func cleanGoDepsCheckOk(check *gitpb.Repo) error {
continue
}
log.Info("not found:", depRepo.GetGoPath())
- err = errors.New("not found: " + depRepo.GetGoPath())
- continue
+ return errors.New("not found: " + depRepo.GetGoPath())
}
// log.Info("found dep", depRepo.GetGoPath())
if depRepo.GetVersion() != found.GetMasterVersion() {
@@ -68,18 +68,23 @@ func cleanGoDepsCheckOk(check *gitpb.Repo) error {
if ok, _ := forgepb.ValidGoVersion(found.GetMasterVersion()); ok {
// can't go get invalid version numbers
cmd := []string{"go", "get", depRepo.GetGoPath() + "@" + found.GetMasterVersion()}
- fixes = append(fixes, cmd)
+ // fixes = append(fixes, cmd)
+ if _, err := shell.RunVerbose(cmd); err != nil {
+ return err
+ }
+ } else {
+ return errors.New(errs)
}
- err = errors.New(errs)
}
}
}
}
- for i, cmd := range fixes {
- log.Info("try cmd", i, cmd)
- check.RunRealtime(cmd)
- }
- return err
+ /*
+ for i, cmd := range fixes {
+ log.Info("try cmd", i, cmd)
+ }
+ */
+ return nil
}
func trimGoSum(check *gitpb.Repo) error {
@@ -103,6 +108,10 @@ func trimGoSum(check *gitpb.Repo) error {
}
for _, line := range strings.Split(string(data), "\n") {
+ line = strings.TrimSpace(line)
+ if line == "" {
+ continue
+ }
parts := strings.Fields(line)
if len(parts) < 3 {
log.Info("WIERD OR BAD:", line)