copr icon indicating copy to clipboard operation
copr copied to clipboard

[RFE] copr-cli should be able to show repo link based on copr name and chroot

Open fedora-copr-github-bot opened this issue 3 years ago • 1 comments

Original issue: https://pagure.io/copr/copr/issue/49 Opened: 2017-03-20 09:19:29 Opened by: hhorak

I haven't found an easy way to get the repo link using the copr cli, when I have just the copr name and chroot name. This would be very handy for automation, since we have tooling that gets copr name and we cannot hard-code the repo links. This is how it could work:

$> copr get-repo <copr> <chroot>

For example:

$> copr get-repo hhorak/mariadb-wrapper epel-7-x86_64
https://copr.fedorainfracloud.org/coprs/hhorak/mariadb-wrapper/repo/epel-7/hhorak-mariadb-wrapper-epel-7.repo

Or directly print output:

$> copr get-repo hhorak/mariadb-wrapper epel-7-x86_64
[hhorak-mariadb-wrapper]
name=Copr repo for mariadb-wrapper owned by hhorak
baseurl=https://copr-be.cloud.fedoraproject.org/results/hhorak/mariadb-wrapper/epel-7-$basearch/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/hhorak/mariadb-wrapper/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1

praiskup commented at 2017-03-20 10:50:21:

Yeah, there's dnf -y copr enable hhorak/mariadb-wrapper, but I can confirm that's not exactly the same thing (apart from the fact there are still problems with yumutils && copr)


hhorak commented at 2017-03-20 16:52:24:

I saw there is some guessing implemented in the copr plugin, so maybe taking this guessing to the copr-cli would make sense.. (expecting the dnf-copr-plugin requires copr-cli, if not, then to some shared library..?)


praiskup commented at 2017-03-21 07:37:38:

Requiring copr-cli or python-copr by python-dnf-plugins-core is not an option IMO. Run-time requirements would affect all installations. Maybe there's some way to have reverse dependency .. and share the code for chroot guessing.

Also, if your request was to get the link only -- what about to add --repo-link-only option to dnf-plugins-core?

I see two major issues ATM in this toipc. (a) there's no yum-based alternative for 'dnf copr enable' and (b) other copr instances don't have such automatic dnf copr enable feature. So to me, those issues smell like we want to have a copr-cli enable (too?).

This is off-topic, but it would be more than nice to have implemented some dependency mechanism among repositories. Some coprs depend on other coprs, and user needs to enable all of them manually ... so maybe this is also a hint to do the "enable" job in copr-cli.


hhorak commented at 2017-03-21 18:43:22:

Since at least the repo content can be showed quite easily, because URL is in expected format, I can do something like this:

curl https://copr.fedorainfracloud.org/coprs/${copr}/{chroot_without_arch} > /etc/yum.repos.d/${copr_without_slash}.repo

which I haven't realized before and should be enough for my use case.

Anyway, the ideas around copr-cli enable look good to me..


msuchy commented at 2017-03-22 10:54:35:

Group repos have slightly different URL.

fedora-copr-github-bot avatar Nov 15 '22 19:11 fedora-copr-github-bot