From 6a91e7d076ceaa33f82a702994628b6bdad04ce1 Mon Sep 17 00:00:00 2001 From: nnyyxxxx Date: Tue, 17 Sep 2024 06:51:46 -0400 Subject: [PATCH 1/3] Fix issues with packager --- tabs/applications-setup/alacritty-setup.sh | 6 ++-- tabs/applications-setup/fastfetch-setup.sh | 6 ++-- tabs/applications-setup/kitty-setup.sh | 6 ++-- tabs/common-script.sh | 2 +- tabs/system-setup/3-global-theme.sh | 14 ++++---- tabs/system-setup/4-remove-snaps.sh | 8 ++--- tabs/system-setup/system-update.sh | 40 +++++++++++----------- 7 files changed, 41 insertions(+), 41 deletions(-) diff --git a/tabs/applications-setup/alacritty-setup.sh b/tabs/applications-setup/alacritty-setup.sh index 92e49d337..eb8a5d4bb 100755 --- a/tabs/applications-setup/alacritty-setup.sh +++ b/tabs/applications-setup/alacritty-setup.sh @@ -5,12 +5,12 @@ setupAlacritty() { echo "Install Alacritty if not already installed..." if ! command_exists alacritty; then - case ${PACKAGER} in + case "$PACKAGER" in pacman) - $ESCALATION_TOOL ${PACKAGER} -S --needed --noconfirm alacritty + $ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm alacritty ;; *) - $ESCALATION_TOOL ${PACKAGER} install -y alacritty + $ESCALATION_TOOL "$PACKAGER" install -y alacritty ;; esac else diff --git a/tabs/applications-setup/fastfetch-setup.sh b/tabs/applications-setup/fastfetch-setup.sh index e3f9a4f72..1415f9a8c 100644 --- a/tabs/applications-setup/fastfetch-setup.sh +++ b/tabs/applications-setup/fastfetch-setup.sh @@ -5,12 +5,12 @@ setupFastfetch() { echo "Installing Fastfetch if not already installed..." if ! command_exists fastfetch; then - case ${PACKAGER} in + case "$PACKAGER" in pacman) - $ESCALATION_TOOL "${PACKAGER}" -S --needed --noconfirm fastfetch + $ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm fastfetch ;; *) - $ESCALATION_TOOL "${PACKAGER}" install -y fastfetch + $ESCALATION_TOOL "$PACKAGER" install -y fastfetch ;; esac else diff --git a/tabs/applications-setup/kitty-setup.sh b/tabs/applications-setup/kitty-setup.sh index 7afbbe5d8..5195a9ccd 100755 --- a/tabs/applications-setup/kitty-setup.sh +++ b/tabs/applications-setup/kitty-setup.sh @@ -5,12 +5,12 @@ setupKitty() { echo "Install Kitty if not already installed..." if ! command_exists kitty; then - case ${PACKAGER} in + case "$PACKAGER" in pacman) - $ESCALATION_TOOL "${PACKAGER}" -S --needed --noconfirm kitty + $ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm kitty ;; *) - $ESCALATION_TOOL "${PACKAGER}" install -y kitty + $ESCALATION_TOOL "$PACKAGER" install -y kitty ;; esac else diff --git a/tabs/common-script.sh b/tabs/common-script.sh index aa4deae95..eca61a8c6 100644 --- a/tabs/common-script.sh +++ b/tabs/common-script.sh @@ -81,7 +81,7 @@ checkPackageManager() { fi done - if [ -z "${PACKAGER}" ]; then + if [ -z ""$PACKAGER"" ]; then printf "%b\n" "${RED}Can't find a supported package manager${RC}" exit 1 fi diff --git a/tabs/system-setup/3-global-theme.sh b/tabs/system-setup/3-global-theme.sh index c3e360da5..985f58566 100644 --- a/tabs/system-setup/3-global-theme.sh +++ b/tabs/system-setup/3-global-theme.sh @@ -6,19 +6,19 @@ install_theme_tools() { printf "%b\n" "${YELLOW}Installing theme tools (qt6ct and kvantum)...${RC}\n" case $PACKAGER in apt-get) - $ESCALATION_TOOL apt-get update - $ESCALATION_TOOL apt-get install -y qt6ct kvantum + $ESCALATION_TOOL "$PACKAGER" update + $ESCALATION_TOOL "$PACKAGER" install -y qt6ct kvantum ;; zypper) - $ESCALATION_TOOL zypper refresh - $ESCALATION_TOOL zypper --non-interactive install qt6ct kvantum + $ESCALATION_TOOL "$PACKAGER" refresh + $ESCALATION_TOOL "$PACKAGER" --non-interactive install qt6ct kvantum ;; dnf) - $ESCALATION_TOOL dnf update - $ESCALATION_TOOL dnf install -y qt6ct kvantum + $ESCALATION_TOOL "$PACKAGER" update + $ESCALATION_TOOL "$PACKAGER" install -y qt6ct kvantum ;; pacman) - $ESCALATION_TOOL pacman -S --needed --noconfirm qt6ct kvantum + $ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm qt6ct kvantum ;; *) printf "%b\n" "${RED}Unsupported package manager. Please install qt6ct and kvantum manually.${RC}\n" diff --git a/tabs/system-setup/4-remove-snaps.sh b/tabs/system-setup/4-remove-snaps.sh index f804aa5b8..e40746d0c 100644 --- a/tabs/system-setup/4-remove-snaps.sh +++ b/tabs/system-setup/4-remove-snaps.sh @@ -5,19 +5,19 @@ removeSnaps() { case $PACKAGER in pacman) - $ESCALATION_TOOL ${PACKAGER} -Rns snapd + $ESCALATION_TOOL "$PACKAGER" -Rns snapd ;; apt-get|nala) - $ESCALATION_TOOL ${PACKAGER} autoremove --purge snapd + $ESCALATION_TOOL "$PACKAGER" autoremove --purge snapd if [ "$ID" = ubuntu ]; then $ESCALATION_TOOL apt-mark hold snapd fi ;; dnf) - $ESCALATION_TOOL ${PACKAGER} remove snapd + $ESCALATION_TOOL "$PACKAGER" remove snapd ;; zypper) - $ESCALATION_TOOL ${PACKAGER} remove snapd + $ESCALATION_TOOL "$PACKAGER" remove snapd ;; *) echo "Removing snapd not implemented for this package manager" diff --git a/tabs/system-setup/system-update.sh b/tabs/system-setup/system-update.sh index e6b32af6d..38d25847b 100755 --- a/tabs/system-setup/system-update.sh +++ b/tabs/system-setup/system-update.sh @@ -3,7 +3,7 @@ . ../common-script.sh fastUpdate() { - case ${PACKAGER} in + case "$PACKAGER" in pacman) $AUR_HELPER -S --needed --noconfirm rate-mirrors-bin @@ -31,27 +31,27 @@ fastUpdate() { $ESCALATION_TOOL apt-get install -y nala || { printf "%b\n" "${YELLOW}Falling back to apt-get${RC}"; PACKAGER="apt-get"; } fi - if [ "${PACKAGER}" = "nala" ]; then + if [ "$PACKAGER" = "nala" ]; then $ESCALATION_TOOL cp /etc/apt/sources.list /etc/apt/sources.list.bak $ESCALATION_TOOL nala update PACKAGER="nala" fi - $ESCALATION_TOOL ${PACKAGER} upgrade -y + $ESCALATION_TOOL "$PACKAGER" upgrade -y ;; dnf) - $ESCALATION_TOOL ${PACKAGER} update -y + $ESCALATION_TOOL "$PACKAGER" update -y ;; zypper) - $ESCALATION_TOOL ${PACKAGER} ref - $ESCALATION_TOOL ${PACKAGER} --non-interactive dup + $ESCALATION_TOOL "$PACKAGER" ref + $ESCALATION_TOOL "$PACKAGER" --non-interactive dup ;; yum) - $ESCALATION_TOOL ${PACKAGER} update -y - $ESCALATION_TOOL ${PACKAGER} upgrade -y + $ESCALATION_TOOL "$PACKAGER" update -y + $ESCALATION_TOOL "$PACKAGER" upgrade -y ;; xbps-install) - $ESCALATION_TOOL ${PACKAGER} -Syu + $ESCALATION_TOOL "$PACKAGER" -Syu ;; *) printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" @@ -62,28 +62,28 @@ fastUpdate() { updateSystem() { printf "%b\n" "${GREEN}Updating system${RC}" - case ${PACKAGER} in + case "$PACKAGER" in nala|apt-get) - $ESCALATION_TOOL "${PACKAGER}" update -y - $ESCALATION_TOOL "${PACKAGER}" upgrade -y + $ESCALATION_TOOL "$PACKAGER" update -y + $ESCALATION_TOOL "$PACKAGER" upgrade -y ;; yum|dnf) - $ESCALATION_TOOL "${PACKAGER}" update -y - $ESCALATION_TOOL "${PACKAGER}" upgrade -y + $ESCALATION_TOOL "$PACKAGER" update -y + $ESCALATION_TOOL "$PACKAGER" upgrade -y ;; pacman) - $ESCALATION_TOOL "${PACKAGER}" -Sy --noconfirm --needed archlinux-keyring - $ESCALATION_TOOL "${PACKAGER}" -Su --noconfirm + $ESCALATION_TOOL "$PACKAGER" -Sy --noconfirm --needed archlinux-keyring + $ESCALATION_TOOL "$PACKAGER" -Su --noconfirm ;; zypper) - $ESCALATION_TOOL ${PACKAGER} ref - $ESCALATION_TOOL ${PACKAGER} --non-interactive dup + $ESCALATION_TOOL "$PACKAGER" ref + $ESCALATION_TOOL "$PACKAGER" --non-interactive dup ;; xbps-install) - $ESCALATION_TOOL ${PACKAGER} -Syu + $ESCALATION_TOOL "$PACKAGER" -Syu ;; *) - printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" + printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}" exit 1 ;; esac From ed175616c3e56d76ae059ecedf57f412e3cde1c7 Mon Sep 17 00:00:00 2001 From: nnyyxxxx Date: Tue, 17 Sep 2024 06:53:57 -0400 Subject: [PATCH 2/3] Fix extra quotes --- tabs/common-script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tabs/common-script.sh b/tabs/common-script.sh index eca61a8c6..d92a62d92 100644 --- a/tabs/common-script.sh +++ b/tabs/common-script.sh @@ -81,7 +81,7 @@ checkPackageManager() { fi done - if [ -z ""$PACKAGER"" ]; then + if [ -z "$PACKAGER" ]; then printf "%b\n" "${RED}Can't find a supported package manager${RC}" exit 1 fi From 4404169e82ff774aa9d39c9f2c961e6900723c0a Mon Sep 17 00:00:00 2001 From: nnyyxxxx Date: Tue, 17 Sep 2024 08:34:29 -0400 Subject: [PATCH 3/3] Fix remaining packagers --- tabs/security/firewall-baselines.sh | 6 +++--- tabs/utils/monitor-control/utility_functions.sh | 8 ++++---- tabs/utils/wifi-control.sh | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tabs/security/firewall-baselines.sh b/tabs/security/firewall-baselines.sh index 5abb0c766..951b6415a 100644 --- a/tabs/security/firewall-baselines.sh +++ b/tabs/security/firewall-baselines.sh @@ -5,12 +5,12 @@ installPkg() { echo "Install UFW if not already installed..." if ! command_exists ufw; then - case ${PACKAGER} in + case "$PACKAGER" in pacman) - $ESCALATION_TOOL "${PACKAGER}" -S --needed --noconfirm ufw + $ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm ufw ;; *) - $ESCALATION_TOOL "${PACKAGER}" install -y ufw + $ESCALATION_TOOL "$PACKAGER" install -y ufw ;; esac else diff --git a/tabs/utils/monitor-control/utility_functions.sh b/tabs/utils/monitor-control/utility_functions.sh index 48b4c8da9..2571800d0 100755 --- a/tabs/utils/monitor-control/utility_functions.sh +++ b/tabs/utils/monitor-control/utility_functions.sh @@ -6,15 +6,15 @@ setup_xrandr() { echo "Install xrandr if not already installed..." if ! command_exists xrandr; then - case ${PACKAGER} in + case "$PACKAGER" in pacman) - $ESCALATION_TOOL "${PACKAGER}" -S --noconfirm xorg-xrandr + $ESCALATION_TOOL "$PACKAGER" -S --noconfirm xorg-xrandr ;; apt-get) - $ESCALATION_TOOL "${PACKAGER}" install -y x11-xserver-utils + $ESCALATION_TOOL "$PACKAGER" install -y x11-xserver-utils ;; *) - $ESCALATION_TOOL "${PACKAGER}" install -y xorg-x11-server-utils + $ESCALATION_TOOL "$PACKAGER" install -y xorg-x11-server-utils ;; esac else diff --git a/tabs/utils/wifi-control.sh b/tabs/utils/wifi-control.sh index 036e2a28c..13b351ead 100644 --- a/tabs/utils/wifi-control.sh +++ b/tabs/utils/wifi-control.sh @@ -8,13 +8,13 @@ setupNetworkManager() { if ! command_exists nmcli; then case ${PACKAGER} in pacman) - $ESCALATION_TOOL "${PACKAGER}" -S --noconfirm networkmanager + $ESCALATION_TOOL "$PACKAGER" -S --noconfirm networkmanager ;; dnf) - $ESCALATION_TOOL "${PACKAGER}" install -y NetworkManager-1 + $ESCALATION_TOOL "$PACKAGER" install -y NetworkManager-1 ;; *) - $ESCALATION_TOOL "${PACKAGER}" install -y network-manager + $ESCALATION_TOOL "$PACKAGER" install -y network-manager ;; esac else