fedora-silverblue / issue-tracker

Fedora Silverblue issue tracker
https://fedoraproject.org/atomic-desktops/silverblue/
126 stars 3 forks source link

Integrate the COPR command #436

Closed boredsquirrel closed 1 year ago

boredsquirrel commented 1 year ago

Is your feature request related to a problem? Please describe. COPR repos can be used normally on Silverblue/Kinoite. I dont know if there are issues with updates though.

Describe the solution you'd like Here is a way to add the command manually (copied from some deleted post):

printf """#!/bin/bash
pushd /tmp

author="$(echo $2 | cut -d '/' -f1)"
reponame="$(echo $2 | cut -d '/' -f2)"

if [ ! $3 ]; then
 releasever="$(rpm -E %fedora)"
else
 releasever=$3
fi

if [[ "$1" == "enable" ]]; then
 echo "$author/$reponame -> $releasever"
 curl -fsSL https://copr.fedorainfracloud.org/coprs/$author/$reponame/repo/fedora-$releasever/$author-$reponame-fedora-.repo | sudo tee /etc/yum.repos.d/$author-$reponame.repo
elif [[ "$1" == "remove" ]]; then
 sudo rm /etc/yum.repos.d/$author-$reponame.repo
fi
""" | sudo tee /var/usrlocal/bin/copr

sudo chmod +x /var/usrlocal/bin/copr

Usage works normally with sudo copr enable x/x

Describe alternatives you've considered Adding this command manually

miabbott commented 1 year ago

I think the best way to solve this would be to have support for a copr-like sub-command in rpm-ostree, rather than a custom script that the Silverblue folks would have to maintain.

There have been various issues on the rpm-ostree repo that touch upon this;

https://github.com/coreos/rpm-ostree/issues/1443 https://github.com/coreos/rpm-ostree/issues/1176 https://github.com/coreos/rpm-ostree/issues/405

The current thinking looks like it is leaning towards using ostree native containers to address this problem.

Alternatively, you can just copy the .repo file to /etc/yum.repos.d/ from the Copr page you are interested in.

boredsquirrel commented 1 year ago

Okay interesting, thanks for the links.

Yes this is what the script does, but automatically. Copying to a root location doesnt work in a nice and user-friendly way.

This script is not really hard to maintain if there are no changes in how COPR works (Github maybe?). All it does is download the correct .repo file to that location.

travier commented 1 year ago

As @miabbott said, this would need to be included in rpm-ostree and the related discussions are linked above. Closing.