From e54c233ac8b8de537ee3c9f278aa0be7b2fc2ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= Date: Tue, 19 Sep 2023 13:26:02 +0200 Subject: [PATCH] repoquery: allow specifying upper-case tags in `--queryformat` It unifies behavior with dnf4 and rpm queryformat. Closes: https://github.com/rpm-software-management/dnf5/issues/861 --- libdnf5-cli/output/repoqueryformat.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libdnf5-cli/output/repoqueryformat.cpp b/libdnf5-cli/output/repoqueryformat.cpp index cca40f7f5..fe3ef498c 100644 --- a/libdnf5-cli/output/repoqueryformat.cpp +++ b/libdnf5-cli/output/repoqueryformat.cpp @@ -19,6 +19,7 @@ along with libdnf. If not, see . #include "fmt/args.h" +#include "utils/string.hpp" #include "libdnf5-cli/output/repoquery.hpp" @@ -191,7 +192,7 @@ std::pair, std::string> parse_queryformat(const std::string state = OUTSIDE; // To get the name we add/subtract 2 becasue each tag name (after brace expansion) starts with "{{". auto getter_name = format.substr(tag_name_start + 2, format_size - tag_name_start - 2); - auto getter = NAME_TO_GETTER.find(getter_name); + auto getter = NAME_TO_GETTER.find(libdnf5::utils::string::tolower(getter_name)); if (getter != NAME_TO_GETTER.end()) { if (replace_tag_in_format(format, format_size, tag_start, tag_name_start)) { getters.push_back(getter->second);