From 73d05d6cfa4f20d641840ff7986535fe2bafc1ab Mon Sep 17 00:00:00 2001 From: Jeevitha Kannan K S Date: Sun, 13 Oct 2024 18:30:02 +0530 Subject: [PATCH] Fix alpine bugs --- .../tabs/applications-setup/Developer-tools/neovim-setup.sh | 2 +- core/tabs/applications-setup/browsers/librewolf.sh | 5 +++++ .../applications-setup/communication-apps/jitsi-setup.sh | 3 --- .../applications-setup/communication-apps/signal-setup.sh | 3 --- core/tabs/applications-setup/linutil-installer.sh | 2 -- core/tabs/applications-setup/linutil-updater.sh | 2 -- core/tabs/common-script.sh | 6 ++++++ core/tabs/system-setup/gaming-setup.sh | 5 ++++- core/tabs/system-setup/global-theme.sh | 5 +++++ core/tabs/system-setup/system-cleanup.sh | 5 ++++- 10 files changed, 25 insertions(+), 13 deletions(-) diff --git a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh b/core/tabs/applications-setup/Developer-tools/neovim-setup.sh index eaaa88f9..7b3a980c 100755 --- a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/neovim-setup.sh @@ -30,7 +30,7 @@ installNeovim() { "$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git ;; apk) - "$ESCALATION_TOOL" "$PACKAGER" add neovim + "$ESCALATION_TOOL" "$PACKAGER" add neovim ripgrep fzf py3-virtualenv luarocks go shellcheck git ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" diff --git a/core/tabs/applications-setup/browsers/librewolf.sh b/core/tabs/applications-setup/browsers/librewolf.sh index 3320a68d..5562954e 100644 --- a/core/tabs/applications-setup/browsers/librewolf.sh +++ b/core/tabs/applications-setup/browsers/librewolf.sh @@ -33,6 +33,11 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/ "$AUR_HELPER" -S --needed --noconfirm librewolf-bin ;; apk) + alpine_version=$(grep . /etc/alpine-release | cut -d . -f 2) + if [ "$alpine_version" -le 20 ]; then + printf "%b\n" "${RED}Only available in edge release of alpine linux${RC}" + exit 1 + fi "$ESCALATION_TOOL" "$PACKAGER" add librewolf ;; *) diff --git a/core/tabs/applications-setup/communication-apps/jitsi-setup.sh b/core/tabs/applications-setup/communication-apps/jitsi-setup.sh index 72133e56..2b6b4bbe 100644 --- a/core/tabs/applications-setup/communication-apps/jitsi-setup.sh +++ b/core/tabs/applications-setup/communication-apps/jitsi-setup.sh @@ -21,9 +21,6 @@ installJitsi() { dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y jitsi-meet ;; - apk) - "$ESCALATION_TOOL" "$PACKAGER" add jitsi-meet - ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/communication-apps/signal-setup.sh b/core/tabs/applications-setup/communication-apps/signal-setup.sh index 00dec431..7f5d70fc 100644 --- a/core/tabs/applications-setup/communication-apps/signal-setup.sh +++ b/core/tabs/applications-setup/communication-apps/signal-setup.sh @@ -23,9 +23,6 @@ installSignal() { "$ESCALATION_TOOL" "$PACKAGER" copr enable luminoso/Signal-Desktop "$ESCALATION_TOOL" "$PACKAGER" install -y signal-desktop ;; - apk) - "$ESCALATION_TOOL" "$PACKAGER" add signal-desktop - ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/linutil-installer.sh b/core/tabs/applications-setup/linutil-installer.sh index e7e4d3d2..2107cb3a 100755 --- a/core/tabs/applications-setup/linutil-installer.sh +++ b/core/tabs/applications-setup/linutil-installer.sh @@ -47,8 +47,6 @@ installLinutil() { ;; apk) "$ESCALATION_TOOL" "$PACKAGER" add build-base - "$ESCALATION_TOOL" sed -i '/community/s/^#//' /etc/apk/repositories - "$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" add rustup rustup-init . $HOME/.cargo/env diff --git a/core/tabs/applications-setup/linutil-updater.sh b/core/tabs/applications-setup/linutil-updater.sh index 6c95fae5..b07219c9 100755 --- a/core/tabs/applications-setup/linutil-updater.sh +++ b/core/tabs/applications-setup/linutil-updater.sh @@ -21,8 +21,6 @@ updateLinutil() { ;; apk) "$ESCALATION_TOOL" "$PACKAGER" add build-base - "$ESCALATION_TOOL" sed -i '/community/s/^#//' /etc/apk/repositories - "$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" add rustup rustup-init ;; diff --git a/core/tabs/common-script.sh b/core/tabs/common-script.sh index ed83753a..56a7ecc0 100644 --- a/core/tabs/common-script.sh +++ b/core/tabs/common-script.sh @@ -82,6 +82,12 @@ checkPackageManager() { fi done + ## Enable apk community packages + if [ "$PACKAGER" = "apk" ] && grep -qE '^#.*community' /etc/apk/repositories; then + "$ESCALATION_TOOL" sed -i '/community/s/^#//' /etc/apk/repositories + "$ESCALATION_TOOL" "$PACKAGER" update + fi + if [ -z "$PACKAGER" ]; then printf "%b\n" "${RED}Can't find a supported package manager${RC}" exit 1 diff --git a/core/tabs/system-setup/gaming-setup.sh b/core/tabs/system-setup/gaming-setup.sh index 92c666c7..08b74f8f 100755 --- a/core/tabs/system-setup/gaming-setup.sh +++ b/core/tabs/system-setup/gaming-setup.sh @@ -50,7 +50,8 @@ installDepend() { "$ESCALATION_TOOL" "$PACKAGER" -n install $DEPENDENCIES ;; *) - "$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES + printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}" + exit 1 ;; esac } @@ -95,6 +96,8 @@ installAdditionalDepend() { "$ESCALATION_TOOL" "$PACKAGER" -n install $DISTRO_DEPS ;; *) + printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}" + exit 1 ;; esac } diff --git a/core/tabs/system-setup/global-theme.sh b/core/tabs/system-setup/global-theme.sh index 927b34d4..1acf7c93 100755 --- a/core/tabs/system-setup/global-theme.sh +++ b/core/tabs/system-setup/global-theme.sh @@ -18,6 +18,11 @@ install_theme_tools() { "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm qt6ct kvantum ;; apk) + alpine_version=$(grep . /etc/alpine-release | cut -d . -f 2) + if [ "$alpine_version" -le 20 ]; then + printf "%b\n" "${RED}Only available in edge release of alpine linux${RC}" + exit 1 + fi "$ESCALATION_TOOL" "$PACKAGER" add qt6ct kvantum ;; *) diff --git a/core/tabs/system-setup/system-cleanup.sh b/core/tabs/system-setup/system-cleanup.sh index 2fe13ae2..f23d0638 100644 --- a/core/tabs/system-setup/system-cleanup.sh +++ b/core/tabs/system-setup/system-cleanup.sh @@ -1,6 +1,7 @@ #!/bin/sh -e . ../common-script.sh +. ../common-service-script.sh cleanup_system() { printf "%b\n" "${YELLOW}Performing system cleanup...${RC}" @@ -39,7 +40,9 @@ common_cleanup() { "$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete "$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete "$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \; - "$ESCALATION_TOOL" journalctl --vacuum-time=3d + if [ "$INIT_MANAGER" = "systemctl" ]; then + "$ESCALATION_TOOL" journalctl --vacuum-time=3d + fi } clean_data() {