feat: Replace copr utility with dnf5 copr wrapper (#1819)

This commit is contained in:
Zeglius 2024-10-30 21:06:53 +01:00 committed by Kyle Gospodnetich
parent 73b724f6f4
commit 656c505237
2 changed files with 15 additions and 2 deletions

View File

@ -200,8 +200,6 @@ RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
# Setup Copr repos
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
curl -Lo /usr/bin/copr https://raw.githubusercontent.com/ublue-os/COPR-command/main/copr && \
chmod +x /usr/bin/copr && \
curl -Lo /etc/yum.repos.d/_copr_kylegospo-bazzite.repo https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/repo/fedora-"${FEDORA_MAJOR_VERSION}"/kylegospo-bazzite-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
curl -Lo /etc/yum.repos.d/_copr_kylegospo-bazzite-multilib.repo https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite-multilib/repo/fedora-"${FEDORA_MAJOR_VERSION}"/kylegospo-bazzite-multilib-fedora-"${FEDORA_MAJOR_VERSION}".repo?arch=x86_64 && \
curl -Lo /etc/yum.repos.d/_copr_ublue-os-staging.repo https://copr.fedorainfracloud.org/coprs/ublue-os/staging/repo/fedora-"${FEDORA_MAJOR_VERSION}"/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo?arch=x86_64 && \

View File

@ -0,0 +1,15 @@
#!/bin/bash
# Wrapper for 'dnf5 copr'
# Includes Workaround to append the chroot "fedora-RELEASE-ARCH"
function dnf5_wrapper() {
precmd="/usr/bin/dnf5 copr"
if [[ $* =~ copr\s+enable && $# -eq 2 ]]; then
exec $precmd enable "$2" "${3:-fedora-"$(lsb_release -sr)"-"$(uname -m)"}"
else
exec $precmd "$@"
fi
return
}
dnf5_wrapper "$@"