From 897217900db72f0714cbef2860f7051d6cc1763d Mon Sep 17 00:00:00 2001 From: Jiri Kyjovsky Date: Fri, 21 Feb 2025 19:15:29 +0100 Subject: [PATCH] Fix: let copr plugin to respect the installroot option --- dnf5-plugins/copr_plugin/copr_repo.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dnf5-plugins/copr_plugin/copr_repo.cpp b/dnf5-plugins/copr_plugin/copr_repo.cpp index 070f79885..af423114c 100644 --- a/dnf5-plugins/copr_plugin/copr_repo.cpp +++ b/dnf5-plugins/copr_plugin/copr_repo.cpp @@ -25,6 +25,7 @@ along with libdnf. If not, see . #include #include +#include #include #include @@ -37,11 +38,14 @@ namespace dnf5 { std::filesystem::path copr_repo_directory() { std::filesystem::path result; + + auto & base = get_context().get_base(); + std::filesystem::path installroot = base.get_config().get_installroot_option().get_value(); if (char * dir = getenv("TEST_COPR_CONFIG_DIR")) { - result = dir; + result = installroot.empty() ? dir : installroot / dir; return result / "yum.repos.d"; } - return COPR_REPO_DIRECTORY; + return installroot.empty() ? COPR_REPO_DIRECTORY : installroot / COPR_REPO_DIRECTORY; }