diff options
| -rw-r--r-- | build.go | 4 | ||||
| -rw-r--r-- | cleanGoSum.go | 6 | ||||
| -rw-r--r-- | finalGoSumCheck.go | 8 | ||||
| -rw-r--r-- | repoNew.go | 7 | ||||
| -rw-r--r-- | scanRepoDir.go | 27 |
5 files changed, 15 insertions, 37 deletions
@@ -62,7 +62,7 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err all := repo.GoDeps.SortByGoPath() for all.Scan() { t := all.Next() - found := f.FindByGoPath(t.GetGoPath()) + found := f.FindByNamespace(t.GetGoPath()) if found.GetRepoType() == "protobuf" { if err := f.runAutogenpb(found); err != nil { return err @@ -200,7 +200,7 @@ func (f *Forge) FindWorkingDirRepo() *gitpb.Repo { pwd, _ := os.Getwd() basedir := strings.TrimPrefix(pwd, f.Config.ReposDir) basedir = strings.Trim(basedir, "/") - return f.FindByGoPath(basedir) + return f.FindByNamespace(basedir) } // Never do this. this is stupid. fix your repo diff --git a/cleanGoSum.go b/cleanGoSum.go index 400ba07..73a2d30 100644 --- a/cleanGoSum.go +++ b/cleanGoSum.go @@ -28,7 +28,7 @@ func (f *Forge) CleanGoDepsCheckOk(check *gitpb.Repo) error { all := check.GoDeps.SortByGoPath() for all.Scan() { depRepo := all.Next() - found := f.FindByGoPath(depRepo.GetGoPath()) + found := f.FindByNamespace(depRepo.GetGoPath()) if found == nil { if f.CheckOverride(depRepo.GetGoPath()) { // skip this gopath because it's probably broken forever @@ -40,7 +40,7 @@ func (f *Forge) CleanGoDepsCheckOk(check *gitpb.Repo) error { } // log.Info("found dep", depRepo.GetGoPath()) if depRepo.GetVersion() != found.GetMasterVersion() { - check := f.FindByGoPath(depRepo.GetGoPath()) + check := f.FindByNamespace(depRepo.GetGoPath()) var ends string if check.CheckDirty() { ends = "(dirty) " @@ -151,7 +151,7 @@ func (f *Forge) TrimGoSum(check *gitpb.Repo) error { if good[gopath] { fmt.Fprintf(newf, "%s %s\n", gopath, stuff[gopath]) fmt.Fprintf(newf, "%s %s\n", gopath, modver[gopath]) - check := f.FindByGoPath(gopath) + check := f.FindByNamespace(gopath) if check == nil { log.Info("gopath does not really exist:", gopath) } diff --git a/finalGoSumCheck.go b/finalGoSumCheck.go index 2d70c3b..dfdbf45 100644 --- a/finalGoSumCheck.go +++ b/finalGoSumCheck.go @@ -35,7 +35,7 @@ func (f *Forge) FinalGoDepsCheckOk(check *gitpb.Repo, verbose bool) error { deps := check.GoDeps.SortByGoPath() for deps.Scan() { depRepo := deps.Next() - found := f.FindByGoPath(depRepo.GetGoPath()) + found := f.FindByNamespace(depRepo.GetGoPath()) if found == nil { if f.CheckOverride(depRepo.GetGoPath()) { // skip this gopath because it's probably broken forever @@ -49,7 +49,7 @@ func (f *Forge) FinalGoDepsCheckOk(check *gitpb.Repo, verbose bool) error { } // log.Info("found dep", depRepo.GetGoPath()) if depRepo.GetVersion() != found.GetTargetVersion() { - check := f.FindByGoPath(depRepo.GetGoPath()) + check := f.FindByNamespace(depRepo.GetGoPath()) if f.Config.IsReadOnly(check.GetGoPath()) { if verbose { log.Printf("%-48s ok error .%s. vs .%s. (ignoring read-only repo)\n", depRepo.GetGoPath(), depRepo.GetVersion(), found.GetTargetVersion()) @@ -117,7 +117,7 @@ func (f *Forge) TestGoDepsCheckOk(godeps *gitpb.GoDeps, verbose bool) error { all := godeps.SortByGoPath() for all.Scan() { depRepo := all.Next() - found := f.FindByGoPath(depRepo.GetGoPath()) + found := f.FindByNamespace(depRepo.GetGoPath()) if found == nil { if f.CheckOverride(depRepo.GetGoPath()) { // skip this gopath because it's probably broken forever @@ -131,7 +131,7 @@ func (f *Forge) TestGoDepsCheckOk(godeps *gitpb.GoDeps, verbose bool) error { } // log.Info("found dep", depRepo.GetGoPath()) if depRepo.GetVersion() != found.GetTargetVersion() { - check := f.FindByGoPath(depRepo.GetGoPath()) + check := f.FindByNamespace(depRepo.GetGoPath()) if f.Config.IsReadOnly(check.GetGoPath()) { if verbose { log.Printf("%-48s ok error .%s. vs .%s. (ignoring read-only repo)\n", depRepo.GetGoPath(), depRepo.GetVersion(), found.GetTargetVersion()) @@ -224,7 +224,12 @@ func (f *Forge) AddFullPath(fulldir string) *gitpb.Repo { return nil } -func (f *Forge) FindByGoPath(gopath string) *gitpb.Repo { +// deprecate +// func (f *Forge) FindByGoPath(gopath string) *gitpb.Repo { +// return f.FindByNamespace(gopath) +// } + +func (f *Forge) FindByNamespace(gopath string) *gitpb.Repo { fullpath := filepath.Join(f.Config.ReposDir, gopath) return f.Repos.FindByFullPath(fullpath) } diff --git a/scanRepoDir.go b/scanRepoDir.go index 4597686..c138353 100644 --- a/scanRepoDir.go +++ b/scanRepoDir.go @@ -23,33 +23,6 @@ func (f *Forge) Reload() map[string]*RillStats { return f.RillRepos(reloadCheck) } -/* -func (f *Forge) TestScan() error { - f.Repos = gitpb.NewRepos() - dirs, err := gitDirectoriesNew(f.Config.ReposDir) - if err != nil { - return err - } - for i, fullpath := range dirs { - repo, err := gitpb.NewRepo(fullpath) - if err != nil { - log.Info("ReAdd() error", fullpath, err) - } - log.Info(i, "worked", repo.FullPath) - repo = f.Repos.Append(repo) - f.VerifyBranchNames(repo) - if f.Config.IsReadOnly(repo.GetGoPath()) { - repo.ReadOnly = true - } - repo.ReloadCheck() - if i > 5 { - break - } - } - return nil -} -*/ - func (f *Forge) checkNamespace(fullpath string) (*gitpb.Repo, error) { if repo := f.Repos.FindByFullPath(fullpath); repo != nil { return nil, nil |
