From 51ff8bc5f6c19d599dbf219df0d8495475f9b4a9 Mon Sep 17 00:00:00 2001 From: fiftydinar <65243233+fiftydinar@users.noreply.github.com> Date: Sun, 22 Dec 2024 22:35:15 +0100 Subject: [PATCH] Update dnf.sh --- modules/dnf/dnf.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/dnf/dnf.sh b/modules/dnf/dnf.sh index c5476fbc..deed39e3 100644 --- a/modules/dnf/dnf.sh +++ b/modules/dnf/dnf.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Tell build process to exit if there are any errors. -set -euo pipefail +set -euxo pipefail # Fail the build if dnf5 isn't installed if ! rpm -q dnf5 &>/dev/null; then @@ -33,7 +33,12 @@ if [[ ${#REPOS[@]} -gt 0 ]]; then for i in "${!REPOS[@]}"; do repo="${REPOS[$i]}" repo="${repo//%OS_VERSION%/${OS_VERSION}}" - REPOS[$i]="${repo//[$'\t\r\n ']}" + # Remove spaces/newlines for all repos other than COPR + if [[ "${repo}" != "COPR "* ]]; then + REPOS[$i]="${repo//[$'\t\r\n ']}" + else + REPOS[$i]="${repo}" + fi done # dnf config-manager & dnf copr don't support adding multiple repositories at once, hence why for/done loop is used for repo in "${REPOS[@]}"; do