Skip to content

Commit

Permalink
feat: Replace copr utility with dnf5 copr wrapper (ublue-os#1819)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeglius authored and KyleGospo committed Oct 30, 2024
1 parent 73b724f commit 656c505
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
15 changes: 15 additions & 0 deletions system_files/desktop/shared/usr/bin/copr
Original file line number Diff line number Diff line change
@@ -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 "$@"

0 comments on commit 656c505

Please sign in to comment.