Repository navigation
Conversation
PR Summary by QodoFix Copr installroot paths and manage per-repository vendor policies
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
|
The last two commits look good. Waiting for #3004 and then a rebase of this one. |
copr_repo_directory() computed the destination directory as
"installroot / COPR_REPO_DIRECTORY". But COPR_REPO_DIRECTORY is
an absolute path ("/etc/yum.repos.d"), and appending an absolute path
with std::filesystem::path::operator/ replaces the left-hand side
entirely -- the installroot was silently discarded. As a result,
"dnf5 --installroot=X copr enable ..." wrote the .repo file into
the host's /etc/yum.repos.d instead of X/etc/yum.repos.d, and
"copr disable"/"copr remove" could not find the repository (they
enumerate repositories from the installroot-prefixed reposdir)
without --use-host-config.
Strip the root directory from COPR_REPO_DIRECTORY with
relative_path() before appending.
The copr plugin now correctly stores .repo files inside the installroot. Update the tests accordingly: - Check that "copr enable" creates the .repo file inside the installroot. - Drop --use-host-config from "copr disable" and the follow-up "repo list": repositories enabled into the installroot are found there now, and the expected paths are installroot-relative. - Add a "Test removing an enabled project" scenario verifying that "copr remove" deletes the .repo file and both vendor change policy files. Also update the @destructive justification: it is no longer about repositories outside the installroot (issue rpm-software-management#1497, fixed), but about the Copr plugin reading its configuration outside the installroot, which the tests need to modify.
440c2ce to
149bc8b
Compare
This PR updates and expands the CI tests, touching on the changes introduced in #3004. Please merge #3004 first.
PR #2081 attempted to fix "copr doesn't use repositories in installroot" (#1497) by prepending the installroot in
copr_repo_directory(). However, the fix did not work. It computed the destination directory asinstallroot / COPR_REPO_DIRECTORYwhereCOPR_REPO_DIRECTORYis an absolute path ("/etc/yum.repos.d"). Appending an absolute path withstd::filesystem::path::operator /replaces the left-hand side entirely, so the installroot was silently discarded:dnf5 --installroot=X copr enable... still wrote the ".repo" file into the host's "/etc/yum.repos.d" instead of "X/etc/yum.repos.d", andcopr disable/copr removecould not find the repository (they enumerate repositories from the installroot-prefixed reposdir) without--use-host-config.Strip the root directory from
COPR_REPO_DIRECTORYbefore appending, so that the installroot is actually prepended.Completes the fix of #1497; fixes the fix from #2081.
CI tests updated and extended.