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 6aa2e46 commit 50d66f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion 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 -euxo pipefail
set -euo pipefail

# Fail the build if dnf5 isn't installed
if ! rpm -q dnf5 &>/dev/null; then
Expand All @@ -24,6 +24,10 @@ if [[ ${#REPOS[@]} -gt 0 ]]; then
for i in "${!REPOS[@]}"; do
repo="${REPOS[$i]}"
repo="${repo//%OS_VERSION%/${OS_VERSION}}"
# Extract copr repo array element properly here without JSON brackets
if [[ "${repo}" == "{\"copr\":\""*"\"}" ]]; then
repo="$(echo "copr: $(echo "${repo}" | jq -r '.copr')")"
fi
REPOS[$i]="${repo//[$'\t\r\n ']}"
done
# dnf config-manager & dnf copr don't support adding multiple repositories at once, hence why for/done loop is used
Expand Down

0 comments on commit 50d66f1

Please sign in to comment.