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