From d776ba4792acd16bd88aaba6ac2920ad1911b4d7 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 21 Oct 2025 06:56:20 -0500 Subject: use ENV --- parseDpkgOutputIntoPB.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'parseDpkgOutputIntoPB.go') diff --git a/parseDpkgOutputIntoPB.go b/parseDpkgOutputIntoPB.go index 170a1c7..168fb22 100644 --- a/parseDpkgOutputIntoPB.go +++ b/parseDpkgOutputIntoPB.go @@ -10,8 +10,8 @@ import ( "os" "strings" + "go.wit.com/lib/ENV" "go.wit.com/lib/cobol" - "go.wit.com/lib/config" "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/zoopb" "go.wit.com/log" @@ -88,14 +88,14 @@ func ParseDpkgOutputIntoPB(pb *zoopb.Package, all string) { } if starting { if parts[0] == "new" { - if config.Verbose() { + if ENV.Verbose() { log.Printf("new: %v\n", parts) } // skip the first dpkg -I line continue } if parts[0] == "size" { - if config.Verbose() { + if ENV.Verbose() { log.Printf("size: %v\n", parts) } // todo: make this correct @@ -106,7 +106,7 @@ func ParseDpkgOutputIntoPB(pb *zoopb.Package, all string) { line = scanner.Text() parts = strings.Fields(line) if strings.HasPrefix(line, " ") { - if config.Verbose() { + if ENV.Verbose() { log.Printf("sizeline: %v\n", parts) } continue @@ -116,7 +116,7 @@ func ParseDpkgOutputIntoPB(pb *zoopb.Package, all string) { } } if starting { - if config.Verbose() { + if ENV.Verbose() { log.Printf("probably real data: %v\n", parts) } if strings.HasSuffix(parts[0], ":") { @@ -129,7 +129,7 @@ func ParseDpkgOutputIntoPB(pb *zoopb.Package, all string) { } varname := strings.TrimRight(parts[0], ":") varval := strings.Join(parts[1:], " ") - if config.Verbose() { + if ENV.Verbose() { log.Printf("varname:%s varval:%s\n", varname, varval) } switch varname { @@ -184,7 +184,7 @@ func ParseDpkgOutputIntoPB(pb *zoopb.Package, all string) { t, err := cobol.GetTime(varval) if t != nil { pb.GitDate = timestamppb.New(*t) - } else if config.Verbose() { + } else if ENV.Verbose() { log.Info("FIXME: Package-Build-Date", varval, err) } case "Deb-File-Date": @@ -192,7 +192,7 @@ func ParseDpkgOutputIntoPB(pb *zoopb.Package, all string) { t, err := cobol.GetTime(varval) if t != nil { pb.GitDate = timestamppb.New(*t) - } else if config.Verbose() { + } else if ENV.Verbose() { log.Info("FIXME: Package-Build-Date", varval, err) } case "Build-Date": @@ -200,18 +200,18 @@ func ParseDpkgOutputIntoPB(pb *zoopb.Package, all string) { t, err := cobol.GetTime(varval) if t != nil { pb.BuildDate = timestamppb.New(*t) - } else if config.Verbose() { + } else if ENV.Verbose() { log.Info("FIXME: Package-Build-Date", varval, err) } case "Package-Build-Date": t, err := cobol.GetTime(varval) if t != nil { pb.BuildDate = timestamppb.New(*t) - } else if config.Verbose() { + } else if ENV.Verbose() { log.Info("FIXME: Package-Build-Date", varval, err) } case "Git-Tag-Date": - if config.Verbose() { + if ENV.Verbose() { log.Info("FIXME: Git-Tag-Date", varval) } case "Description": -- cgit v1.2.3