versionlock: Fix wildcards handling in add
command
#2009
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There’s a bug in how the
dnf5 versionlock add <spec>
command handlespackage specifications when the
spec
contains a wildcard and matchesmultiple package names with the same version (EVR). In such cases, only
the first package is considered, while the rest are quietly skipped.
For example there are three packages matching 'aws-checksums*' pattern,
but only one is actually locked:
❯ dnf repoquery 'aws-checksums*'
Repositories loaded.
aws-checksums-0:0.2.2-1.fc40.i686
aws-checksums-0:0.2.2-1.fc40.x86_64
aws-checksums-devel-0:0.2.2-1.fc40.i686
aws-checksums-devel-0:0.2.2-1.fc40.x86_64
aws-checksums-libs-0:0.2.2-1.fc40.i686
aws-checksums-libs-0:0.2.2-1.fc40.x86_64
❯ dnf versionlock add 'aws-checksums*'
Repositories loaded.
Adding versionlock on "aws-checksums = 0.2.2-1.fc40".
With this patch, each group of packages with the same name is handled
separately, ensuring that all the packages are correctly locked:
❯ dnf5 versionlock add 'aws-checksums*'
Repositories loaded.
Adding versionlock on "aws-checksums = 0.2.2-1.fc40".
Adding versionlock on "aws-checksums-devel = 0.2.2-1.fc40".
Adding versionlock on "aws-checksums-libs = 0.2.2-1.fc40".
For: #1895