Skip to content

Commit

Permalink
Fix alpine bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevithakannan2 committed Oct 13, 2024
1 parent 45a880a commit 73d05d6
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
5 changes: 5 additions & 0 deletions core/tabs/applications-setup/browsers/librewolf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions core/tabs/applications-setup/linutil-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions core/tabs/applications-setup/linutil-updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand Down
6 changes: 6 additions & 0 deletions core/tabs/common-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion core/tabs/system-setup/gaming-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -95,6 +96,8 @@ installAdditionalDepend() {
"$ESCALATION_TOOL" "$PACKAGER" -n install $DISTRO_DEPS
;;
*)
printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}"
exit 1
;;
esac
}
Expand Down
5 changes: 5 additions & 0 deletions core/tabs/system-setup/global-theme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
*)
Expand Down
5 changes: 4 additions & 1 deletion core/tabs/system-setup/system-cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh -e

. ../common-script.sh
. ../common-service-script.sh

cleanup_system() {
printf "%b\n" "${YELLOW}Performing system cleanup...${RC}"
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 73d05d6

Please sign in to comment.