summaryrefslogtreecommitdiff
path: root/goDep.redoGoMod.go
diff options
context:
space:
mode:
Diffstat (limited to 'goDep.redoGoMod.go')
-rw-r--r--goDep.redoGoMod.go32
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
}