-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(amazon): save system files for pkgs containing
amzn
in src (#5951)
Signed-off-by: knqyf263 <[email protected]> Co-authored-by: knqyf263 <[email protected]>
- Loading branch information
1 parent
260aa28
commit fbc1a83
Showing
2 changed files
with
66 additions
and
3 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 |
---|---|---|
|
@@ -165,6 +165,62 @@ func Test_rpmPkgAnalyzer_listPkgs(t *testing.T) { | |
"/lib64/libm-2.27.so", | ||
}, | ||
}, | ||
{ | ||
name: "Amazon official package without `Vendor` field", | ||
mock: mock{ | ||
packages: []*rpmdb.PackageInfo{ | ||
{ | ||
Name: "curl-minimal", | ||
Version: "8.3.0", | ||
Release: "1.amzn2023.0.2", | ||
Arch: "aarch64", | ||
SourceRpm: "curl-8.3.0-1.amzn2023.0.2.src.rpm", | ||
DirNames: []string{ | ||
"/usr/bin/", | ||
"/usr/lib/", | ||
"/usr/lib/.build-id/", | ||
"/usr/lib/.build-id/aa/", | ||
"/usr/share/man/man1/", | ||
}, | ||
DirIndexes: []int32{0, 1, 2, 3, 4}, | ||
BaseNames: []string{ | ||
"curl", | ||
".build-id", | ||
"aa", | ||
"d987ea9bc1c73706d12c7a143ee792117851ff", | ||
"curl.1.gz", | ||
}, | ||
Vendor: "", | ||
}, | ||
}, | ||
}, | ||
wantPkgs: types.Packages{ | ||
{ | ||
ID: "[email protected]", | ||
Name: "curl-minimal", | ||
Version: "8.3.0", | ||
Release: "1.amzn2023.0.2", | ||
Arch: "aarch64", | ||
SrcName: "curl", | ||
SrcVersion: "8.3.0", | ||
SrcRelease: "1.amzn2023.0.2", | ||
InstalledFiles: []string{ | ||
"/usr/bin/curl", | ||
"/usr/lib/.build-id", | ||
"/usr/lib/.build-id/aa", | ||
"/usr/lib/.build-id/aa/d987ea9bc1c73706d12c7a143ee792117851ff", | ||
"/usr/share/man/man1/curl.1.gz", | ||
}, | ||
}, | ||
}, | ||
wantFiles: []string{ | ||
"/usr/bin/curl", | ||
"/usr/lib/.build-id", | ||
"/usr/lib/.build-id/aa", | ||
"/usr/lib/.build-id/aa/d987ea9bc1c73706d12c7a143ee792117851ff", | ||
"/usr/share/man/man1/curl.1.gz", | ||
}, | ||
}, | ||
{ | ||
name: "invalid source rpm", | ||
mock: mock{ | ||
|