summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-11-02 08:58:56 -0600
committerJeff Carr <[email protected]>2025-11-02 08:58:56 -0600
commitab7db21e07faac62f1abfb2b33634586979a0ded (patch)
tree19a58f865c31be555f75b00cd213796ca542a4ee
parent6fa3221e265933038342acb50caad3c2bbb6c136 (diff)
new gitpb/repo.protodevel
-rw-r--r--build.go2
-rw-r--r--cleanGoSum.go4
-rw-r--r--finalGoSumCheck.go2
-rw-r--r--init.go4
-rw-r--r--load.go6
-rw-r--r--rill.go8
-rw-r--r--scanRepoDir.go6
7 files changed, 19 insertions, 13 deletions
diff --git a/build.go b/build.go
index 9dd84f1..4a1bd5c 100644
--- a/build.go
+++ b/build.go
@@ -59,7 +59,7 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err
// if not GoPrimitive, autogen each dependent git repo
if repo.GoDepsLen() != 0 {
// build the protobuf files in all protobuf repos
- all := repo.GoDeps.SortByGoPath()
+ all := repo.GoInfo.GoDeps.SortByGoPath()
for all.Scan() {
t := all.Next()
found := f.Repos.FindByNamespace(t.GetGoPath())
diff --git a/cleanGoSum.go b/cleanGoSum.go
index d98fb56..e45fdc5 100644
--- a/cleanGoSum.go
+++ b/cleanGoSum.go
@@ -22,10 +22,10 @@ func (f *Forge) CleanGoDepsCheckOk(check *gitpb.Repo) error {
var fixes [][]string
log.Printf("%s repo go dependancy count: %d\n", check.GetGoPath(), check.GoDepsLen())
- if check.GoDeps == nil {
+ if check.GoInfo.GoDeps == nil {
return errors.New("check.GoDeps == nil")
}
- all := check.GoDeps.SortByGoPath()
+ all := check.GoInfo.GoDeps.SortByGoPath()
for all.Scan() {
depRepo := all.Next()
found := f.Repos.FindByNamespace(depRepo.GetGoPath())
diff --git a/finalGoSumCheck.go b/finalGoSumCheck.go
index 0646d39..f177124 100644
--- a/finalGoSumCheck.go
+++ b/finalGoSumCheck.go
@@ -33,7 +33,7 @@ func (f *Forge) FinalGoDepsCheckOk(check *gitpb.Repo) error {
return nil
}
- deps := check.GoDeps.SortByGoPath()
+ deps := check.GoInfo.GoDeps.SortByGoPath()
for deps.Scan() {
depRepo := deps.Next()
found := f.Repos.FindByNamespace(depRepo.GetGoPath())
diff --git a/init.go b/init.go
index 26daa49..90bb402 100644
--- a/init.go
+++ b/init.go
@@ -142,14 +142,14 @@ func (f *Forge) postInit() error {
}
} else {
log.Printf("forge failed to load %s file with len(%d) repos err=(%v)\n", f.Repos.Filename, f.Repos.Len(), err)
- panic("failed to load repos.pb")
+ panic("failed to load .pb cache")
}
err = f.patchesCacheLoad() // loads the file from ~/.cache/forge/patches.pb
if err == nil {
// log.Printf("forge loaded %s file with len(%d) repos\n", f.Repos.Filename, f.Repos.Len())
} else {
log.Printf("forge failed to load %s file with len(%d) patches err=(%v)\n", f.Patches.Filename, f.Patches.Len(), err)
- panic("failed to load repos.pb")
+ panic("failed to load .pb cache")
}
return err
}
diff --git a/load.go b/load.go
index 38790bd..e5c2f8c 100644
--- a/load.go
+++ b/load.go
@@ -81,15 +81,19 @@ func (f *Forge) reposCacheLoad() error {
// if using a go.work file, the filename should have already been set
fullname = env.Get("ReposPB")
}
+ if env.Verbose() {
+ env.PrintTable()
+ }
f.Repos = gitpb.NewRepos()
f.Repos.Filename = fullname
- err := config.ReLoad(f.Repos)
+ err := config.ForceCreatePB(f.Repos)
if err == nil {
if f.Repos.Filename != fullname {
// reset the filename, user probably did "mv" or "cp"
f.Repos.Filename = fullname
}
env.SetGlobal("lib/forgepb", "ReposPB", f.Repos.Filename)
+ log.Printf("%s repos len = %d\n", f.Repos.Filename, f.Repos.Len())
}
return err
}
diff --git a/rill.go b/rill.go
index ad181ee..bd25d4e 100644
--- a/rill.go
+++ b/rill.go
@@ -161,8 +161,8 @@ func (f *Forge) RillRepos(rillf func(*gitpb.Repo) error) map[string]*RillStats {
}
// returns the set of failed repos
-func (f *Forge) RunOnReposNew(repos *gitpb.Repos, rillf func(*gitpb.Repo) error) *gitpb.Repos {
- stats := f.RunOnRepos(repos, rillf)
+func (f *Forge) RunOnRepos(repos *gitpb.Repos, rillf func(*gitpb.Repo) error) *gitpb.Repos {
+ stats := f.RunOnReposOld(repos, rillf)
failed := gitpb.NewRepos()
for s, stat := range stats {
if stat.Err == nil {
@@ -184,7 +184,7 @@ func (f *Forge) RunOnReposNew(repos *gitpb.Repos, rillf func(*gitpb.Repo) error)
// Use this if you think SMP processing might be the problem.
// if this works, and GO Rill doesn't work, then you, yes you, are the problem. Your code sucks.
// fix it, happy hacking
-func (f *Forge) RunOnReposNewDumb(repos *gitpb.Repos, rillf func(*gitpb.Repo) error) *gitpb.Repos {
+func (f *Forge) RunOnReposSlow(repos *gitpb.Repos, rillf func(*gitpb.Repo) error) *gitpb.Repos {
failed := gitpb.NewRepos()
counter := 1
for repo := range repos.IterAll() {
@@ -204,7 +204,7 @@ func (f *Forge) RunOnReposNewDumb(repos *gitpb.Repos, rillf func(*gitpb.Repo) er
// y is how many simultanous functions will run
// todo: tune and compute x,y by # of CPUs and disk io
// todo: store x,y in forge config ? (or compute them. notsure)
-func (f *Forge) RunOnRepos(repos *gitpb.Repos, rillf func(*gitpb.Repo) error) map[string]*RillStats {
+func (f *Forge) RunOnReposOld(repos *gitpb.Repos, rillf func(*gitpb.Repo) error) map[string]*RillStats {
var all []*gitpb.Repo
var stats map[string]*RillStats
diff --git a/scanRepoDir.go b/scanRepoDir.go
index c9c6d78..881067c 100644
--- a/scanRepoDir.go
+++ b/scanRepoDir.go
@@ -175,15 +175,17 @@ func gitDirectoriesNew(srcDir string) ([]string, error) {
log.Info("WARNING:")
log.Info("WARNING: you have files that are untracked by .git repos here")
log.Info("WARNING:")
- log.Printf("WARNING: you have %d untracked files %d paths\n", len(untracked), len(dirs))
count := 0
for _, file := range untracked {
- log.Info(file)
+ log.Info("WARNING:", file)
if count > 7 {
break
}
count += 1
}
+ log.Info("WARNING:")
+ log.Printf("WARNING: you have %d untracked files %d paths\n", len(untracked), len(dirs))
+ log.Info("WARNING:")
}
return all, err
}