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

repoquery: Allow uppercased query tags #1922

Merged

Conversation

jlebon
Copy link
Contributor

@jlebon jlebon commented Apr 14, 2023

Before v4.15.0, query tags could be specified as both uppercased or lowercased. As part of commit e50488b ("repoquery: Properly sanitize queryformat strings"), this was (I believe) unintentionally changed to only support the lowercase variant.

Although the documented supported tags are lowercase (as printed by dnf repoquery --querytags), it's clear that the intention here is to mirror rpm's query tags APIs. Confusingly, the canonical tag names for the latter are uppercased (as printed by rpm --querytags), though the lowercase variants are still supported.

Let's restore support for uppercased query tags to match rpm more closely and unbreak anyone who assumed this was officially supported.

Before v4.15.0, query tags could be specified as both uppercased or
lowercased. As part of commit e50488b ("repoquery: Properly sanitize
queryformat strings"), this was (I believe) unintentionally changed to
only support the lowercase variant.

Although the documented supported tags are lowercase (as printed by
`dnf repoquery --querytags`), it's clear that the intention here is to
mirror rpm's query tags APIs. Confusingly, the canonical tag names for
the latter are uppercased (as printed by `rpm --querytags`), though the
lowercase variants are still supported.

Let's restore support for uppercased query tags to match rpm more
closely and unbreak anyone who assumed this was officially supported.
jlebon added a commit to jlebon/coreos-assembler that referenced this pull request Apr 14, 2023
Uppercase query tags broke in dnf v4.15.0. There is an upstream PR[[1]]
to track restoring support for them, but since the canonical tag names
are lowercase, switch to that.

Fixes coreos/rpm-ostree#4368

[1]: rpm-software-management/dnf#1922
jlebon added a commit to jlebon/coreos-assembler that referenced this pull request Apr 14, 2023
Uppercase query tags broke in dnf v4.15.0. There is an upstream PR[[1]]
to track restoring support for them, but since the canonical tag names
are lowercase, switch to that.

Fixes coreos/rpm-ostree#4368.

[1]: rpm-software-management/dnf#1922
@jlebon
Copy link
Contributor Author

jlebon commented Apr 14, 2023

This technically also allows e.g. %{NaMe}, though it doesn't seem worth the effort of trying to be so strict. And rpm also tolerates this.

@jan-kolarik
Copy link
Member

Hey, that was my todo task for Monday! 😃 Thanks for that, I will do the review.

@jan-kolarik jan-kolarik self-assigned this Apr 14, 2023
Copy link
Member

@jan-kolarik jan-kolarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@jan-kolarik jan-kolarik merged commit de9c5c5 into rpm-software-management:master Apr 17, 2023
cgwalters pushed a commit to coreos/coreos-assembler that referenced this pull request Apr 17, 2023
Uppercase query tags broke in dnf v4.15.0. There is an upstream PR[[1]]
to track restoring support for them, but since the canonical tag names
are lowercase, switch to that.

Fixes coreos/rpm-ostree#4368.

[1]: rpm-software-management/dnf#1922
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants