-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(akmods): Utilize
readonly
for static variables
- Loading branch information
1 parent
c8fc3c8
commit 58946ae
Showing
1 changed file
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
function ENABLE_MULTIMEDIA_REPO { | ||
ENABLE_MULTIMEDIA_REPO() { | ||
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo | ||
sed -i "0,/enabled/ s@enabled=0@enabled=1@g" /etc/yum.repos.d/negativo17-fedora-multimedia.repo | ||
} | ||
readonly -f ENABLE_MULTIMEDIA_REPO | ||
|
||
function DISABLE_MULTIMEDIA_REPO { | ||
DISABLE_MULTIMEDIA_REPO() { | ||
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo | ||
} | ||
readonly -f DISABLE_MULTIMEDIA_REPO | ||
|
||
function SET_HIGHER_PRIORITY_AKMODS_REPO { | ||
SET_HIGHER_PRIORITY_AKMODS_REPO() { | ||
echo "priority=90" >> /etc/yum.repos.d/_copr_ublue-os-akmods.repo | ||
} | ||
readonly -f SET_HIGHER_PRIORITY_AKMODS_REPO | ||
|
||
get_yaml_array INSTALL '.install[]' "$1" | ||
|
||
INSTALL_PATH=("${INSTALL[@]/#/\/tmp/rpms/kmods/*}") | ||
INSTALL_PATH=("${INSTALL_PATH[@]/%/*.rpm}") | ||
INSTALL_STR=$(echo "${INSTALL_PATH[*]}" | tr -d '\n') | ||
readonly INSTALL_PATH=("${INSTALL_PATH[@]/%/*.rpm}") | ||
readonly INSTALL_STR=$(echo "${INSTALL_PATH[*]}" | tr -d '\n') | ||
|
||
if [[ ${#INSTALL[@]} -gt 0 ]]; then | ||
echo "Installing akmods" | ||
echo "Installing: $(echo "${INSTALL[*]}" | tr -d '\n')" | ||
SET_HIGHER_PRIORITY_AKMODS_REPO | ||
ENABLE_MULTIMEDIA_REPO | ||
rpm-ostree install $INSTALL_STR | ||
rpm-ostree install ${INSTALL_STR} | ||
DISABLE_MULTIMEDIA_REPO | ||
fi |