-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 RPM: fix match "(none)" vendor (#4791)
* fix: match (none) vendor * fix+extend the unit test
- Loading branch information
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ func TestRedhat8Parser(t *testing.T) { | |
} | ||
|
||
m := ParseRpmPackages(pf, c.Stdout) | ||
assert.Equal(t, 190, len(m), "detected the right amount of packages") | ||
assert.Equal(t, 192, len(m), "detected the right amount of packages") | ||
|
||
p := Package{ | ||
Name: "ncurses-base", | ||
|
@@ -147,6 +147,24 @@ func TestRedhat8Parser(t *testing.T) { | |
} | ||
assert.Equal(t, p, findPkg(m, p.Name), p.Name) | ||
|
||
// Package with (none) vendor and arch | ||
p = Package{ | ||
Name: "gpg-pubkey", | ||
Version: "d4082792-5b32db75", | ||
Vendor: "(none)", | ||
Description: "gpg(Red Hat, Inc. (auxiliary key) <[email protected]>)", | ||
Format: RpmPkgFormat, | ||
FilesAvailable: PkgFilesAsync, | ||
PUrl: "pkg:rpm/rhel/gpg-pubkey@d4082792-5b32db75?distro=rhel-8.4", | ||
CPEs: []string{ | ||
"cpe:2.3:a:\\(none\\):gpg-pubkey:d4082792-5b32db75:*:*:*:*:*:*:*", | ||
"cpe:2.3:a:\\(none\\):gpg-pubkey:d4082792:*:*:*:*:*:*:*", | ||
"cpe:2.3:a:\\(none\\):gpg-pubkey:d4082792-5b32db75:*:*:*:*:*:*:*", | ||
"cpe:2.3:a:\\(none\\):gpg-pubkey:d4082792:*:*:*:*:*:*:*", | ||
}, | ||
} | ||
assert.Equal(t, p, findPkg(m, p.Name), p.Name) | ||
|
||
// fetch package files | ||
p = Package{ | ||
Name: "which", | ||
|