fixes for new autogenpb

This commit is contained in:
Jeff Carr 2025-01-12 20:05:57 -06:00
parent 7df10fba51
commit 4aa85a2f0f
6 changed files with 7 additions and 11 deletions

View File

@ -62,11 +62,7 @@ func (all *Repos) ConfigLoad() error {
func (all *Repos) sampleConfig() {
newr := new(Repo)
newr.FullPath = "/opt/forge/dummyentry"
if all.Append(newr) {
log.Info("added", newr.GetGoPath(), "ok")
} else {
log.Info("added", newr.GetGoPath(), "failed")
}
all.Append(newr)
}
func loadFile(fullname string) ([]byte, error) {

View File

@ -23,11 +23,11 @@ func (all *GitTags) newSort() *GitTagIterator {
// all this code below is junk and seamingly wrong
func (all *GitTags) SortByAge() *GitTagIterator {
packs := all.selectAllGitTag()
packs := all.selectAllGitTags()
sort.Sort(GitTagAge(packs))
iterator := NewGitTagIterator(packs)
iterator := newGitTagIterator(packs)
return iterator
}

View File

@ -13,7 +13,7 @@ func (repo *Repo) DeleteGoDepByHash(hash string) {
// enforces no duplicate package names
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

View File

@ -54,7 +54,7 @@ func (repo *Repo) ParseGoSum() bool {
if repo.GoDeps == nil {
repo.GoDeps = new(GoDeps)
}
repo.GoDeps.AppendUniqueGoPath(&new1)
repo.GoDeps.AppendByGoPath(&new1)
} else {
log.Info("gitpb.ParseGoSum() go.sum parse error invalid:", line)
return false

View File

@ -19,5 +19,5 @@ message GoDep { // `autogenpb:marshal`
message GoDeps { // `autogenpb:marshal`
string uuid = 1; // `autogenpb:uuid:`
string version = 2; // `autogenpb:version`
repeated GoDep goDeps = 3;
repeated GoDep goDeps = 3; // `autogenpb:unique` `autogenpb:sort`
}

View File

@ -34,7 +34,7 @@ func (all *Repos) NewGoRepo(fullpath string, gopath string) (*Repo, error) {
// everything happens in here
newr.Reload()
if all.AppendUniqueFullPath(&newr) {
if all.AppendByFullPath(&newr) {
// worked
return &newr, nil
} else {