diff options
| author | Jeff Carr <[email protected]> | 2025-10-14 02:47:01 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-14 02:47:01 -0500 |
| commit | d614a16a551d8f918236c9ff2494046a6385c7b8 (patch) | |
| tree | b8f57e52f9cda4d4eb47bf841f6ac1e72b3faabb /parseDpkgOutputIntoPB.go | |
| parent | ffc907088d357a8e3250ac5f2edb531cd51d9f9d (diff) | |
add missing fields to parse()
Diffstat (limited to 'parseDpkgOutputIntoPB.go')
| -rw-r--r-- | parseDpkgOutputIntoPB.go | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/parseDpkgOutputIntoPB.go b/parseDpkgOutputIntoPB.go index 7c5ef69..cfb8573 100644 --- a/parseDpkgOutputIntoPB.go +++ b/parseDpkgOutputIntoPB.go @@ -14,6 +14,9 @@ import ( // PARSES "dpkg -I <p.Filename>" // panic() on anything missing or unknown func ParseDpkgOutputIntoPB(pb *zoopb.Package, all string) { + if pb.DebInfo == nil { + pb.DebInfo = new(zoopb.DebInfo) + } starting := true scanner := bufio.NewScanner(strings.NewReader(all)) for scanner.Scan() { @@ -53,14 +56,21 @@ func ParseDpkgOutputIntoPB(pb *zoopb.Package, all string) { } if starting { if config.Verbose() { - log.Printf("parts: %v\n", parts) + log.Printf("probably real data: %v\n", parts) + } + if strings.HasSuffix(parts[0], ":") { + log.Printf("yep, real data: %s\n", parts[0]) + starting = false + } else { + continue } - continue } } varname := strings.TrimSuffix(parts[0], ":") varval := strings.Join(parts[1:], " ") - // log.Printf("varname:%s varval:%s\n", varname, varval) + if config.Verbose() { + log.Printf("varname:%s varval:%s\n", varname, varval) + } switch varname { case "Package": pb.Package = varval @@ -85,7 +95,14 @@ func ParseDpkgOutputIntoPB(pb *zoopb.Package, all string) { pb.DebInfo.URL = varval case "Build-Depends": pb.DebInfo.BuildDepends = varval - case "Installed-Size:": + case "Namespace": + pb.Namespace = varval + case "MD5Sum": + pb.DebInfo.MD5SUM = varval + case "SHA256": + pb.DebInfo.SHA256 = varval + case "Size": + pb.DebInfo.Size = varval case "Installed-Size": pb.DebInfo.InstalledSize = varval case "Homepage": @@ -101,6 +118,9 @@ func ParseDpkgOutputIntoPB(pb *zoopb.Package, all string) { log.Info("FIXME: Package-Build-Date", varval, err) } } + case "Deb-File-Date": + t, _ := cobol.GetTime(varval) + pb.Ctime = timestamppb.New(t) case "Build-Date": case "Package-Build-Date": t, err := cobol.GetTime(varval) |
