fixes for new autogenpb
This commit is contained in:
parent
7df10fba51
commit
4aa85a2f0f
|
@ -62,11 +62,7 @@ func (all *Repos) ConfigLoad() error {
|
||||||
func (all *Repos) sampleConfig() {
|
func (all *Repos) sampleConfig() {
|
||||||
newr := new(Repo)
|
newr := new(Repo)
|
||||||
newr.FullPath = "/opt/forge/dummyentry"
|
newr.FullPath = "/opt/forge/dummyentry"
|
||||||
if all.Append(newr) {
|
all.Append(newr)
|
||||||
log.Info("added", newr.GetGoPath(), "ok")
|
|
||||||
} else {
|
|
||||||
log.Info("added", newr.GetGoPath(), "failed")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadFile(fullname string) ([]byte, error) {
|
func loadFile(fullname string) ([]byte, error) {
|
||||||
|
|
|
@ -23,11 +23,11 @@ func (all *GitTags) newSort() *GitTagIterator {
|
||||||
// all this code below is junk and seamingly wrong
|
// all this code below is junk and seamingly wrong
|
||||||
|
|
||||||
func (all *GitTags) SortByAge() *GitTagIterator {
|
func (all *GitTags) SortByAge() *GitTagIterator {
|
||||||
packs := all.selectAllGitTag()
|
packs := all.selectAllGitTags()
|
||||||
|
|
||||||
sort.Sort(GitTagAge(packs))
|
sort.Sort(GitTagAge(packs))
|
||||||
|
|
||||||
iterator := NewGitTagIterator(packs)
|
iterator := newGitTagIterator(packs)
|
||||||
return iterator
|
return iterator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ func (repo *Repo) DeleteGoDepByHash(hash string) {
|
||||||
|
|
||||||
// enforces no duplicate package names
|
// enforces no duplicate package names
|
||||||
func (repo *Repo) AppendGoDep(newP *GoDep) bool {
|
func (repo *Repo) AppendGoDep(newP *GoDep) bool {
|
||||||
return repo.GoDeps.AppendUniqueGoPath(newP)
|
return repo.GoDeps.AppendByGoPath(newP)
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns time.Duration since last scan of go.sum & go.mod
|
// returns time.Duration since last scan of go.sum & go.mod
|
||||||
|
|
|
@ -54,7 +54,7 @@ func (repo *Repo) ParseGoSum() bool {
|
||||||
if repo.GoDeps == nil {
|
if repo.GoDeps == nil {
|
||||||
repo.GoDeps = new(GoDeps)
|
repo.GoDeps = new(GoDeps)
|
||||||
}
|
}
|
||||||
repo.GoDeps.AppendUniqueGoPath(&new1)
|
repo.GoDeps.AppendByGoPath(&new1)
|
||||||
} else {
|
} else {
|
||||||
log.Info("gitpb.ParseGoSum() go.sum parse error invalid:", line)
|
log.Info("gitpb.ParseGoSum() go.sum parse error invalid:", line)
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -19,5 +19,5 @@ message GoDep { // `autogenpb:marshal`
|
||||||
message GoDeps { // `autogenpb:marshal`
|
message GoDeps { // `autogenpb:marshal`
|
||||||
string uuid = 1; // `autogenpb:uuid:`
|
string uuid = 1; // `autogenpb:uuid:`
|
||||||
string version = 2; // `autogenpb:version`
|
string version = 2; // `autogenpb:version`
|
||||||
repeated GoDep goDeps = 3;
|
repeated GoDep goDeps = 3; // `autogenpb:unique` `autogenpb:sort`
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ func (all *Repos) NewGoRepo(fullpath string, gopath string) (*Repo, error) {
|
||||||
// everything happens in here
|
// everything happens in here
|
||||||
newr.Reload()
|
newr.Reload()
|
||||||
|
|
||||||
if all.AppendUniqueFullPath(&newr) {
|
if all.AppendByFullPath(&newr) {
|
||||||
// worked
|
// worked
|
||||||
return &newr, nil
|
return &newr, nil
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue