diff options
Diffstat (limited to 'cobol.go')
| -rw-r--r-- | cobol.go | 47 |
1 files changed, 16 insertions, 31 deletions
@@ -2,7 +2,6 @@ package main import ( "fmt" - "os" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" @@ -34,7 +33,7 @@ func doCobol() { log.DaemonMode(true) log.Info(standardStart5("gopath", "cur name", "master", "user", "repo type")) - all := me.found.SortByGoPath() + all := me.found.SortByFullPath() for all.Scan() { repo := all.Next() verifyPrint(repo) @@ -78,19 +77,12 @@ func verifyPrint(repo *gitpb.Repo) { } s := make(map[string]string) if !verify(repo, s) { - log.Info("going to delete", repo.GoPath) + log.Info("going to delete", repo.GetGoPath()) if argv.Fix { - me.forge.Repos.DeleteByGoPath(repo.GetGoPath()) + me.forge.DeleteByGoPath(repo.GetGoPath()) me.forge.Repos.ConfigSave() } else { - log.Info("need argv --real to delete", repo.GoPath) - os.Exit(0) - } - } - if me.forge.Config.IsReadOnly(repo.GoPath) { - if repo.ReadOnly { - } else { - log.Info("readonly flag on repo is wrong", repo.GoPath) + log.Info("need argv --fix to delete", repo.GetGoPath()) } } @@ -101,7 +93,7 @@ func verifyPrint(repo *gitpb.Repo) { // start := fmt.Sprintf("%-40s %-12s %-12s %-12s %-8s", s["gopath"], cname, mhort, uhort, s["rtype"]) start := standardStart5(s["gopath"], cname, mhort, uhort, s["rtype"]) - if me.forge.Config.IsReadOnly(repo.GoPath) { + if me.forge.Config.IsReadOnly(repo.GetGoPath()) { end += "(readonly) " } @@ -110,46 +102,39 @@ func verifyPrint(repo *gitpb.Repo) { func verify(repo *gitpb.Repo, s map[string]string) bool { s["gopath"] = repo.GetGoPath() - s["rtype"] = repo.RepoType() + s["rtype"] = repo.GetRepoType() s["mname"] = repo.GetMasterBranchName() if s["mname"] == "" { - log.Info("verify() no master branch name", repo.GoPath) + log.Info("verify() no master branch name", repo.FullPath) s["mver"] = repo.GetMasterVersion() - return false - } - // only verify the master branch name with read-only repos - if me.forge.Config.IsReadOnly(repo.GoPath) { - s["mver"] = repo.GetMasterVersion() - return true + // return false } + s["mver"] = repo.GetMasterVersion() s["dname"] = repo.GetDevelBranchName() if s["dname"] == "" { - log.Info("verify() no devel branch name", repo.GoPath) - return false + log.Info("verify() no devel branch name", repo.GetGoPath()) + // return false } s["uname"] = repo.GetUserBranchName() if s["uname"] == "" { - log.Info("verify() no user branch name", repo.GoPath) - return false + log.Info("verify() no user branch name", repo.GetGoPath()) + // return false } s["cname"] = repo.GetCurrentBranchName() s["mver"] = repo.GetMasterVersion() if s["mver"] == "" { - log.Info("verify() no master branch name", repo.GoPath, repo.GetMasterBranchName()) - return false + log.Info("verify() no master branch name", repo.FullPath, repo.GetMasterBranchName()) } s["dver"] = repo.GetDevelVersion() if s["dver"] == "" { - log.Info("verify() no devel branch name", repo.GoPath, repo.GetDevelBranchName()) - return false + log.Info("verify() no devel branch name", repo.GetGoPath(), repo.GetDevelBranchName()) } s["uver"] = repo.GetUserVersion() if s["uver"] == "" { - log.Info("verify() no user branch name", repo.GoPath, repo.GetUserBranchName()) - return false + log.Info("verify() no user branch name", repo.GetGoPath(), repo.GetUserBranchName()) } s["cver"] = repo.GetCurrentBranchVersion() s["url"] = repo.URL |
