What is the purpose of DNF’s COPR plugin? I understand the purpose of COPR, but not the plugin. I mean, why we just add COPR repos with dnf config-manager/manually? COPR repos are just standard RPM repos and COPR plugin add .repo file to /etc/yum.d/ just like config-manager do?
The plugin helps you do that without knowing the URL. It also helps you manage dependencies (if a copr repo needs another one) and search copr via the API.
I think he was guessing on what the url would be.
When I used the copr command I saw Do you really want to enable copr.fedorainfracloud.org/barryascott/tools? [y/N]: y
and the repo file shows a different baseurl baseurl=https://download.copr.fedorainfracloud.org/results/barryascott/tools/fedora-$releasever-$basearch/
echo -e "[copr:copr.fedorainfracloud.org:barryascott:tools]\nname=Copr repo for tools owned by barryascott\nbaseurl=https://download.copr.fedorainfracloud.org/results/barryascott/tools/fedora-$releasever-$basearch/\ntype=rpm-md\nskip_if_unavailable=True\ngpgcheck=1\ngpgkey=https://download.copr.fedorainfracloud.org/results/barryascott/tools/pubkey.gpg\nrepo_gpgcheck=0\nenabled=1\nenabled_metadata=1" | sudo tee /etc/yum.repos.d/_copr\:copr.fedorainfracloud.org\:barryascott\:tools.repo
I think the reason is managing many repositories for testing. It’s like package repo manager. You add repo hub and install packages add repositories. This works because usually these testing repositories are hosted on public hub/service, since every random guy doesn’t want host by own.
Think about: COPR is basically just for hacking/testing. We don’t one huge testing repo to where any random guy can put anything. So every guy need own repo. That repo usually contain just a few package and testers want add many repos and then copr plugin comes in. You can search with dnf copr search and add repositories easy with dnf copr enable.
So, I think now, the plugin is very cool and useful. I was worried when I thought that copr plugin try make copr.fedorainfracloud.org something centralized system that is bolted to Fedora Linux by default… but I can add every hub I want (check files /etc/dnf/plugins/copr.conf and /etc/dnf/plugins/copr.d). There is e.g. https://eur.openeuler.openatom.cn.
It also helps you manage dependencies (if a copr repo needs another one)
I think, we have to try keep the API stable/standard. The copr plugin should be able to be used reliably with hub/service that use copr or something else.
I think that is related to the fact that once you have enabled a repo using the copr command given above then from that point on dnf is able to use the content of that repo and install provided packages – including the required dependencies that may be involved.
Since I use very few copr repos I cannot be 100% certain, but I do know that a copr repo simply contains rpm packages that were built by that maintainer and that often they are not stand-alone packages but may have other dependencies from the main fedora repo (or even another copr repo) and the wording of that It also helps you manage dependencies (if a copr repo needs another one)
would imply that if one copr repo required a package from another copr repo it may even be able to enable the second repo for you.
I understand that, but wonder, how copr technically do that? How RPM tell to DNF its need for another copr repo? Usually RPM just mark “I need xyz.fc38.x86_64 package” and dont repo that provides it.
As far as I know the copr system does not have meta data on extra needed repos for install dependencies, there is a way to add extra repos for build dependencies.
When I needed to add 2 related copr repos they where both manually added on my systems.
I found this and I got know that copr build system have feature add depency repositories with coprdep: prefix to .repo file. Copr dnf plugin tells to user if .repo file that it download from the hub contain them.
It also helps you manage dependencies (if a copr repo needs another one)
It seems admin of copr repo can configure .repo file for this, but copr plugin doesn’t know anything about this. Packages doesn’t care about this. Only think is, when you enabling .repo file that contains dependency repos, it tell to you.
One copr repo can provide more than one package, in particular possibly rebuilt or newly built dependencies, and it provides them as a standard yum/dnf repo so that dependencies are resolved automatically.
One copr repo can depend on another one during build (the setting you mentioned).
I vaguely remembered that you can specify additional repos which your copr repo (packages) depend on. Alas, I couldn’t find that information (any more) and consider it “dubious” now
That last point also explains why I couldn’t just answer quickly …
Copr are package build system that builds RPM packages and distributes them via DNF/YUM repo. Copr plugin speed up adding these repos which are usually located in only a few hubs/services. Copr plugin is Python program that just configure files in /etc/yum.repos.d/ directory.
So DNF sees the repos (that copr plugin added) completely normal and of course package dependencies are treated normally.
What? The feature I told you is about that new packages from copr repo may need dependencies from another repo and simplifying adding those repos. Nothing to do with building.
Now I think that such feature exist. Please read this link, then bottom of this page and then this.
And hey, thanks for your replies!