Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reorder rhelv2 required files #1264

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions pkg/rhelv2/rpm/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,24 @@ const (
)

var (
// AllRHELRequiredFiles lists all the names of the files required to identify RHEL-based releases.
AllRHELRequiredFiles set.StringSet
// allRHELRequiredFiles lists all the names of the files required to identify RHEL-based releases.
allRHELRequiredFiles set.StringSet

// contentManifestsDirs set with all known directories that might contain content manifest files.
contentManifestDirs set.StringSet
)

func init() {
AllRHELRequiredFiles.AddAll(RequiredFilenames()...)
AllRHELRequiredFiles.AddAll(redhatrelease.RequiredFilenames...)
AllRHELRequiredFiles.AddAll(osrelease.RequiredFilenames...)
// Do this first, as RequiredFilenames() requires this.
contentManifestDirs.AddAll(
// Certified RHEL images.
"root/buildinfo/content_manifests",
// RHCOS nodes.
"usr/share/buildinfo")
"usr/share/buildinfo",
)
allRHELRequiredFiles.AddAll(RequiredFilenames()...)
allRHELRequiredFiles.AddAll(redhatrelease.RequiredFilenames...)
allRHELRequiredFiles.AddAll(osrelease.RequiredFilenames...)
}

// ListFeatures returns the features found in the given files as a slice of
Expand All @@ -65,7 +67,7 @@ func listFeatures(files analyzer.Files, testing bool) ([]*database.RHELv2Package
// AddToDependencyMap checks and adds files to executable and library dependency for RHEL package
func AddToDependencyMap(filename string, fileData analyzer.FileData, execToDeps, libToDeps database.StringToStringsMap) {
// The first character is always "/", which is removed when inserted into the layer files.
if fileData.Executable && !AllRHELRequiredFiles.Contains(filename[1:]) {
if fileData.Executable && !allRHELRequiredFiles.Contains(filename[1:]) {
deps := set.NewStringSet()
if fileData.ELFMetadata != nil {
deps.AddAll(fileData.ELFMetadata.ImportedLibraries...)
Expand Down
Loading