From 670284c6677d88641baf34b15074ba07c19b9b15 Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Tue, 24 Sep 2024 13:51:13 +0200 Subject: [PATCH] copr: use pubkey URL returned by Copr API See https://github.com/fedora-copr/copr/issues/3375 When an alternative storage (such as Pulp) for Copr is used, the pubkey.gpg is still being stored on Copr backend. Therefore we can't always construct the correct pubkey URL here in the DNF plugin. --- dnf5-plugins/copr_plugin/copr_repo.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dnf5-plugins/copr_plugin/copr_repo.cpp b/dnf5-plugins/copr_plugin/copr_repo.cpp index 70d479485..b109903cd 100644 --- a/dnf5-plugins/copr_plugin/copr_repo.cpp +++ b/dnf5-plugins/copr_plugin/copr_repo.cpp @@ -277,7 +277,11 @@ CoprRepo::CoprRepo( std::string results_url = json->get_dict_item("results_url")->string(); std::string baseurl = results_url + "/" + project_owner + "/" + project_dirname + "/" + baseurl_chroot + "/"; std::string name = "Copr repo for " + project_dirname + " owned by " + project_owner; + std::string gpgkey = results_url + "/" + project_owner + "/" + project_name + "/" + "pubkey.gpg"; + if (json->has_key("pubkey_url")) { + gpgkey = json->get_dict_item("pubkey_url")->string(); + } auto main_repo_json = json_repos->get_dict_item(json_selector)->get_dict_item("arch")->get_dict_item(arch); auto main_repo = CoprRepoPart(repo_id, name, true, baseurl, gpgkey);