add whatprovides resolution to verify-install plugin#4804
add whatprovides resolution to verify-install plugin#4804vaibhavdaren wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements the resolution of virtual RPM provides to actual package names using 'rpm -q --whatprovides' during artifact preparation and installation verification. In 'verify_installation.py', replace the dictionary comprehension for 'verify_map' with a loop using 'setdefault' and 'tmt.utils.uniq' to prevent overwriting entries when multiple virtual provides resolve to the same package name.
| verify_map: dict[str, list[str]] = { | ||
| resolved.get(pkg, pkg): repos for pkg, repos in self.data.verify.items() | ||
| } |
There was a problem hiding this comment.
The dictionary comprehension used to construct verify_map will overwrite entries if multiple virtual provides resolve to the same package name (e.g., /usr/bin/sh and sh both resolving to bash). This results in the loss of repository verification data for the overwritten entries. Use a loop with setdefault to merge the repository lists instead.
| verify_map: dict[str, list[str]] = { | |
| resolved.get(pkg, pkg): repos for pkg, repos in self.data.verify.items() | |
| } | |
| verify_map: dict[str, list[str]] = {} | |
| for pkg, repos in self.data.verify.items(): | |
| verify_map.setdefault(resolved.get(pkg, pkg), []).extend(repos) | |
| verify_map = {name: tmt.utils.uniq(repos) for name, repos in verify_map.items()} |
725fbcf to
1d6cf0d
Compare
1d6cf0d to
06f3660
Compare
Pull Request Checklist