Build deps: Clearer variable names

This commit is contained in:
Libretto 2024-04-21 23:49:16 +02:00
parent 9f69f9a954
commit 6deef1d40a

View file

@ -1,14 +1,14 @@
#!/bin/bash
# This script is installing the required dependencies to correctly run the pipeline and build the flatpak
unset result
unset pkg_mgr
# rpm-ostree must be checked before dnf because a dnf (wrapper) command also works on rpm-ostree distros (not what we want)
for pkg_manager in apt pacman rpm-ostree dnf; do
command -v "$pkg_manager" &> /dev/null && result="$pkg_manager" && break
for potential_pkg_mgr in apt pacman rpm-ostree dnf; do
command -v "$potential_pkg_mgr" &> /dev/null && pkg_mgr="$potential_pkg_mgr" && break
done
case $result in
case "$pkg_mgr" in
apt)
sudo apt install -y flatpak flatpak-builder p7zip-full xmlstarlet bzip2 curl jq
;;
@ -23,7 +23,7 @@ case $result in
sudo dnf install -y flatpak flatpak-builder p7zip p7zip-plugins xmlstarlet bzip2 curl
;;
*)
echo "Package manager $result not supported. Please open an issue."
echo "Package manager $pkg_mgr not supported. Please open an issue."
;;
esac