diff options
| author | Jeff Carr <[email protected]> | 2024-12-01 16:04:07 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-01 16:04:07 -0600 |
| commit | 412658698a6d1ad09d64723e9a10e676c77afa94 (patch) | |
| tree | d9b3622eee7414982589dc0496c76854fd1b7600 /goDep.redoGoMod.go | |
| parent | 82935ae6b2d413322b18a9b487973e5ab04e6efd (diff) | |
Repotype() working somewhatv0.0.15
Diffstat (limited to 'goDep.redoGoMod.go')
| -rw-r--r-- | goDep.redoGoMod.go | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/goDep.redoGoMod.go b/goDep.redoGoMod.go index 72249fe..d75f32a 100644 --- a/goDep.redoGoMod.go +++ b/goDep.redoGoMod.go @@ -124,6 +124,22 @@ func (repo *Repo) parseGoSum() (bool, error) { return true, nil } func (repo *Repo) RepoType() string { + if repo.GetGoPlugin() { + return "plugin" + } + if repo.GetGoBinary() { + return "binary" + } + if ok, _, _ := repo.IsProtobuf(); ok { + return "protobuf" + } + if repo.GetGoLibrary() { + return "library" + } + return "" +} + +func (repo *Repo) goListRepoType() string { os.Setenv("GO111MODULE", "off") cmd := []string{"go", "list", "-f", "'{{if eq .Name \"main\"}}binary{{else}}library{{end}}'"} // cmd := []string{"go", "list", "-f", "'{{.Name}}'"} // probably use this. this just prints out the package name @@ -221,7 +237,7 @@ func (repo *Repo) PublishedLen() int { // returns true if the last published func (all *Repos) GoDepsChanged(repo *Repo) (bool, error) { - var match bool = true + var upgrade bool = false if repo.GoDeps == nil { repo.RedoGoMod() @@ -238,9 +254,17 @@ func (all *Repos) GoDepsChanged(repo *Repo) (bool, error) { } found := repo.Published.FindByGoPath(depRepo.GetGoPath()) if found == nil { - return true, errors.New("new repo added " + depRepo.GetGoPath()) + log.Printf("dep %-50s %-10s vs %-10s", depRepo.GetGoPath(), depRepo.GetVersion(), "NEW") + upgrade = true + continue + // return upgrade, errors.New("new repo added " + depRepo.GetGoPath()) + } + if depRepo.GetVersion() == found.GetVersion() { + // log.Printf("deps %-50s %-10s vs %-10s", depRepo.GetGoPath(), depRepo.GetVersion(), found.GetVersion()) + } else { + log.Printf("dep %-50s %-10s vs %-10s BROKEN", depRepo.GetGoPath(), depRepo.GetVersion(), found.GetVersion()) + upgrade = true } - log.Printf("deps %-50s %-10s vs %-10s", depRepo.GetGoPath(), depRepo.GetVersion(), found.GetVersion()) } - return match, nil + return upgrade, nil } |
