mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
hide digests for rpm dirs
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
parent
e415bb21e7
commit
1c2254f5cf
2 changed files with 12 additions and 7 deletions
|
@ -97,14 +97,19 @@ func extractRpmdbFileRecords(resolver source.FilePathResolver, entry *rpmdb.Pack
|
|||
for _, record := range entry.Files {
|
||||
// only persist RPMDB file records which exist in the image/directory, otherwise ignore them
|
||||
if resolver.HasPath(record.Path) {
|
||||
records = append(records, pkg.RpmdbFileRecord{
|
||||
Path: record.Path,
|
||||
Mode: pkg.RpmdbFileMode(record.Mode),
|
||||
Size: int(record.Size),
|
||||
Digest: file.Digest{
|
||||
var digest *file.Digest
|
||||
if record.Digest != "" {
|
||||
digest = &file.Digest{
|
||||
Value: record.Digest,
|
||||
Algorithm: entry.DigestAlgorithm.String(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
records = append(records, pkg.RpmdbFileRecord{
|
||||
Path: record.Path,
|
||||
Mode: pkg.RpmdbFileMode(record.Mode),
|
||||
Size: int(record.Size),
|
||||
Digest: digest,
|
||||
UserName: record.Username,
|
||||
GroupName: record.Groupname,
|
||||
Flags: record.Flags.String(),
|
||||
|
|
|
@ -37,7 +37,7 @@ type RpmdbFileRecord struct {
|
|||
Path string `json:"path"`
|
||||
Mode RpmdbFileMode `json:"mode"`
|
||||
Size int `json:"size"`
|
||||
Digest file.Digest `json:"digest"`
|
||||
Digest *file.Digest `json:"digest,omitempty"`
|
||||
UserName string `json:"userName"`
|
||||
GroupName string `json:"groupName"`
|
||||
Flags string `json:"flags"`
|
||||
|
|
Loading…
Reference in a new issue