Improve stability

This commit is contained in:
Muhammad Rivan 2021-06-11 09:17:28 +07:00
parent 2429e2178c
commit fae1cd0c81
No known key found for this signature in database
GPG key ID: C56A200FD936FAAA
2 changed files with 11 additions and 7 deletions

View file

@ -235,7 +235,7 @@ signal_error() {
IFS=$'\n' IFS=$'\n'
local sources=($(basename -a "${WHITESUR_SOURCE[@]}" "${BASH_SOURCE[@]}" | sort -u)) local sources=($(basename -a "${WHITESUR_SOURCE[@]}" "${BASH_SOURCE[@]}" | sort -u))
local dist_ids=($(awk -F '=' '/ID/{print $2}' "/etc/os-release" | sort -Vru)) local dist_ids=($(awk -F '=' '/ID/{print $2}' "/etc/os-release" | tr -d '"' | sort -Vru))
local repo_ver="" local repo_ver=""
local lines=() local lines=()
local log="$(awk '{printf "\033[1;31m >>> %s\n", $0}' "${WHITESUR_TMP_DIR}/error_log.txt" || echo "")" local log="$(awk '{printf "\033[1;31m >>> %s\n", $0}' "${WHITESUR_TMP_DIR}/error_log.txt" || echo "")"

View file

@ -36,6 +36,10 @@ WHITESUR_SOURCE+=("lib-install.sh")
# remove it, and you run 'sudo dnf upgrade', and boom! Your 'sudo' and other # remove it, and you run 'sudo dnf upgrade', and boom! Your 'sudo' and other
# system utilities have gone! # system utilities have gone!
#----------------------APT---------------------#
# Some apt version doesn't update the repo list before it install some app.
# It may cause "unable to fetch..." when you're trying to install them
installation_sorry() { installation_sorry() {
prompt -w "WARNING: We're sorry, your distro isn't officially supported yet." prompt -w "WARNING: We're sorry, your distro isn't officially supported yet."
prompt -i "INSTRUCTION: Please make sure you have installed all of the required dependencies. We'll continue the installation in 15 seconds" prompt -i "INSTRUCTION: Please make sure you have installed all of the required dependencies. We'll continue the installation in 15 seconds"
@ -102,7 +106,7 @@ prepare_xbps() {
install_theme_deps() { install_theme_deps() {
if ! has_command glib-compile-resources || ! has_command sassc || ! has_command xmllint || if ! has_command glib-compile-resources || ! has_command sassc || ! has_command xmllint ||
(! is_my_distro "clear-linux" && [[ ! -r "/usr/share/gtk-engines/murrine.xml" ]]); then (! is_my_distro "clear-linux" && [[ ! -r "/usr/share/gtk-engines/murrine.xml" ]]); then
prompt -w "\n 'glib2.0', 'sassc', 'xmllint', and 'libmurrine' are required for theme installation.\n" prompt -w "'glib2.0', 'sassc', 'xmllint', and 'libmurrine' are required for theme installation."
if has_command zypper; then if has_command zypper; then
sudo zypper in -y sassc glib2-devel gtk2-engine-murrine libxml2-tools sudo zypper in -y sassc glib2-devel gtk2-engine-murrine libxml2-tools
@ -110,7 +114,7 @@ install_theme_deps() {
# Rolling release # Rolling release
prepare_swupd && sudo swupd bundle-add libglib libxml2 && install_swupd_packages sassc libsass prepare_swupd && sudo swupd bundle-add libglib libxml2 && install_swupd_packages sassc libsass
elif has_command apt; then elif has_command apt; then
sudo apt install -y sassc libglib2.0-dev-bin gtk2-engines-murrine libxml2-utils sudo apt update && sudo apt install -y sassc libglib2.0-dev-bin gtk2-engines-murrine libxml2-utils
elif has_command dnf; then elif has_command dnf; then
sudo dnf install -y sassc glib2-devel gtk-murrine-engine libxml2 sudo dnf install -y sassc glib2-devel gtk-murrine-engine libxml2
elif has_command yum; then elif has_command yum; then
@ -133,7 +137,7 @@ install_theme_deps() {
install_beggy_deps() { install_beggy_deps() {
if ! has_command convert; then if ! has_command convert; then
prompt -w "\n 'imagemagick' are required for background editing.\n" prompt -w "'imagemagick' are required for background editing."
if has_command zypper; then if has_command zypper; then
sudo zypper in -y ImageMagick sudo zypper in -y ImageMagick
@ -141,7 +145,7 @@ install_beggy_deps() {
# Rolling release # Rolling release
prepare_swupd && sudo swupd bundle-add ImageMagick prepare_swupd && sudo swupd bundle-add ImageMagick
elif has_command apt; then elif has_command apt; then
sudo apt install -y imagemagick sudo apt update && sudo apt install -y imagemagick
elif has_command dnf; then elif has_command dnf; then
sudo dnf install -y ImageMagick sudo dnf install -y ImageMagick
elif has_command yum; then elif has_command yum; then
@ -160,7 +164,7 @@ install_beggy_deps() {
install_dialog_deps() { install_dialog_deps() {
if ! has_command dialog; then if ! has_command dialog; then
prompt -w "\n 'dialog' is required for this option.\n" prompt -w "'dialog' is required for this option."
if has_command zypper; then if has_command zypper; then
sudo zypper in -y dialog sudo zypper in -y dialog
@ -168,7 +172,7 @@ install_dialog_deps() {
# Rolling release # Rolling release
prepare_swupd && install_swupd_packages dialog prepare_swupd && install_swupd_packages dialog
elif has_command apt; then elif has_command apt; then
sudo apt install -y dialog sudo apt update && sudo apt install -y dialog
elif has_command dnf; then elif has_command dnf; then
sudo dnf install -y dialog sudo dnf install -y dialog
elif has_command yum; then elif has_command yum; then