From bab0ecf924c0f4ddbac5b86ba226a742828c8b40 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 9 Oct 2025 06:23:08 -0500 Subject: fixes to the .proto file --- apt.go | 4 ++-- populatePackagePB.go | 2 +- update.go | 4 ++-- wit.go | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apt.go b/apt.go index 357a3a1..8cdfc41 100644 --- a/apt.go +++ b/apt.go @@ -73,10 +73,10 @@ func initPackages(me *zoopb.Machine) { // Print the installed packages and their versions for pkg, version := range newP { new1 := new(zoopb.Package) - new1.Name = pkg + new1.Package = pkg new1.Version = version me.Packages.Append(new1) - // log.Info("added", new1.Name, "failed") + // log.Info("added", new1.Package, "failed") } getMemory(me) diff --git a/populatePackagePB.go b/populatePackagePB.go index 1d9b900..ad39069 100644 --- a/populatePackagePB.go +++ b/populatePackagePB.go @@ -7,7 +7,7 @@ import ( "go.wit.com/lib/config" ) -func setString(pb proto.Message, varname string, varvalue string) (bool, error) { +func SetString(pb proto.Message, varname string, varvalue string) (bool, error) { msg := pb.ProtoReflect() // This is the entry point to the reflection API. descriptor := msg.Descriptor() // Get the message's descriptor, which contains metadata about its fields. diff --git a/update.go b/update.go index 5c8de16..e61c38f 100644 --- a/update.go +++ b/update.go @@ -89,11 +89,11 @@ func UpdatePackages(me *zoopb.Machine) error { // Print the installed packages and their versions for pname, version := range newP { - found := me.Packages.FindByName(pname) + found := me.Packages.FindByPackage(pname) if found == nil { log.Info("adding new", pname, version) new1 := new(zoopb.Package) - new1.Name = pname + new1.Package = pname new1.Version = version me.Packages.Append(new1) } else { diff --git a/wit.go b/wit.go index cbc6377..222731b 100644 --- a/wit.go +++ b/wit.go @@ -21,7 +21,7 @@ func InitWitMirrors(m *zoopb.Machine) error { // adds the package if the name isn't there // if it's newer, remove the old package and use the new one func AddIfNewer(all *zoopb.Packages, p *zoopb.Package) { - check := all.FindByName(p.Name) + check := all.FindByPackage(p.Package) if check == nil { all.Append(p) return @@ -62,7 +62,7 @@ func fillPB(p *zoopb.Package, namemap map[string]string) error { if varname == "Git-Tag-Date" { varname = "GitTagDate" } - if ok, err := setString(p, varname, s); ok { + if ok, err := SetString(p, varname, s); ok { continue } else { log.Printf("%s: var=%s val=%s err=%v\n", p.Package, varname, s, err) @@ -167,9 +167,9 @@ func parsePackageInfo(lines string) (*zoopb.Package, map[string]string) { } p := zoopb.Package{ - Name: name, + Package: name, Version: version, - PkgName: filename, + Filename: filename, Namespace: gopath, } -- cgit v1.2.3