Skip to content

Commit

Permalink
Update dnf.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftydinar authored Dec 22, 2024
1 parent abf0c3b commit 51ff8bc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/dnf/dnf.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 51ff8bc

Please sign in to comment.