Skip to content

Commit

Permalink
copr: use pubkey URL returned by Copr API
Browse files Browse the repository at this point in the history
See fedora-copr/copr#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.
  • Loading branch information
FrostyX authored and evan-goode committed Sep 25, 2024
1 parent b53196d commit 9d57058
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dnf5-plugins/copr_plugin/copr_repo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9d57058

Please sign in to comment.