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

Checker: Fix checking of missing files #441

Merged
merged 5 commits into from
Sep 19, 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
19 changes: 18 additions & 1 deletion cmd/csaf_checker/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1115,18 +1115,35 @@ func (p *processor) checkMissing(string) error {
for _, f := range files {
v := p.alreadyChecked[f]
var where []string
// mistake contains which requirements are broken
var mistake whereType
for mask := rolieMask; mask <= listingMask; mask <<= 1 {
if maxMask&mask == mask {
var in string
if v&mask == mask {
in = "in"
} else {
in = "not in"
// Which file is missing entries?
mistake |= mask
}
where = append(where, in+" "+mask.String())
}
}
p.badIntegrities.error("%s %s", f, strings.Join(where, ", "))
// List error in all appropriate categories
if mistake&(rolieMask|indexMask|changesMask|listingMask) == 0 {
continue
}
joined := strings.Join(where, ", ")
report := func(mask whereType, msgs *topicMessages) {
if mistake&mask != 0 {
msgs.error("%s %s", f, joined)
}
}
report(rolieMask, &p.badROLIEFeed)
report(indexMask, &p.badIndices)
report(changesMask, &p.badChanges)
report(listingMask, &p.badDirListings)
}
return nil
}
Expand Down