summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-03 13:23:35 -0600
committerJeff Carr <[email protected]>2024-12-03 13:23:35 -0600
commita3a54501f650b04d672dd935f817c7f4c315c09a (patch)
tree02c7fae2765b3c523bfdec7ce8bfd8684e21752a
parent8e29098aa8dc663490b83f636ed65f1080b29e3c (diff)
-rw-r--r--main.go42
1 files changed, 24 insertions, 18 deletions
diff --git a/main.go b/main.go
index 28cf6ac..9e2d3d6 100644
--- a/main.go
+++ b/main.go
@@ -47,6 +47,9 @@ func main() {
log.Info("yep, need to clone", argv.Repo)
} else {
log.Info("already have", argv.Repo)
+ if argv.Recursive {
+ recursiveClone()
+ }
build()
okExit(argv.Repo)
}
@@ -173,31 +176,34 @@ func gitPull() {
log.Info("Total repositories:", forge.Repos.Len(), "Total attempted:", trycount, "Errors:", errcount)
}
+// really only does go.sum things
+// so not 'really' recursive
+// but that is because go.sum is supposed
+// to have everything required in it
func recursiveClone() {
+ var good int
+ var bad int
// this works sometimes
if argv.Recursive {
- newr := rv.FindByName(argv.Repo)
- if newr == nil {
- log.Info("how did this repo still not exist?", argv.Repo)
- badExit(errors.New("failed to clone repo: " + argv.Repo))
- }
- os.Setenv("REPO_AUTO_CLONE", "true")
- godep := newr.Status.GetGoDeps()
- for gopath, version := range godep {
- pb, err := forge.Clone(gopath)
- if err != nil {
- log.Info("could not download")
- badExit(err)
- }
- repo, err := rv.AddRepo(pb)
+ check := forge.Repos.FindByGoPath(argv.Repo)
+
+ log.Info("download deps for:", check.GoPath)
+ deps := check.GoDeps.SortByGoPath()
+ for deps.Scan() {
+ depRepo := deps.Next()
+ log.Info("download:", depRepo.GoPath)
+ _, err := forge.Clone(depRepo.GoPath)
if err != nil {
- log.Info("git clone failed for", gopath, version)
- continue
+ log.Info("could not download", depRepo.GoPath)
+ log.Info("err:", err)
+ bad += 1
+ } else {
+ log.Info("downloaded", depRepo.GoPath)
+ good += 1
}
- // always do this for now. probably always forever
- repo.MakeRedoMod()
}
}
+ log.Info("got", good, "repos", "failed on", bad, "repos")
}
func redoGoModAll() {