Skip to content

Commit

Permalink
chore: Improve RPMFusion repo install robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftydinar authored Nov 24, 2024
1 parent 83d5dcf commit 5b75595
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions modules/bling/installers/rpmfusion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
# Tell build process to exit if there are any errors.
set -euo pipefail

# Check if rpmfusion is already installed before running
if [[ "$(rpm -q rpmfusion-free-release)" != "rpmfusion-free-release"* && "$(rpm -q rpmfusion-nonfree-release)" != "rpmfusion-nonfree-release"* ]]; then

echo "running rpmfusion install..."
rpm-ostree install \
"https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${OS_VERSION}.noarch.rpm" \
"https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${OS_VERSION}.noarch.rpm"

# check if negativo17 repo is installed
if [[ -f /etc/yum.repos.d/negativo17-fedora-multimedia.repo ]]; then
echo "making sure negativo17 repo is disabled"
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo
fi
NEGATIVO_REPO_FILE="$(awk -F'=' '$1 == "name" && $2 == "negativo17 - Multimedia" {print FILENAME}' /etc/yum.repos.d/*)"

# Check if rpmfusion is already installed before running
if ! rpm -q rpmfusion-free-release &>/dev/null && ! rpm -q rpmfusion-nonfree-release &>/dev/null; then
echo "Running RPMFusion repo install..."
rpm-ostree install \
"https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${OS_VERSION}.noarch.rpm" \
"https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${OS_VERSION}.noarch.rpm"
# check if negativo17 repo is installed
if [[ -n "${NEGATIVO_REPO_FILE}" ]]; then
echo "Making sure that Negativo17 repo is disabled"
sed -i 's@enabled=1@enabled=0@g' "${NEGATIVO_REPO_FILE}"
fi
else

echo "rpmfusion is already installed"

fi
echo "RPMFusion repo is already installed"
fi

0 comments on commit 5b75595

Please sign in to comment.