Improve stability
This commit is contained in:
parent
b44ef3a5ed
commit
2429e2178c
14
lib-core.sh
14
lib-core.sh
@ -21,7 +21,7 @@ WHITESUR_SOURCE=("lib-core.sh")
|
|||||||
#--------------System--------------#
|
#--------------System--------------#
|
||||||
|
|
||||||
export WHITESUR_PID=$$
|
export WHITESUR_PID=$$
|
||||||
export MY_USERNAME="$(logname 2> /dev/null || echo ${SUDO_USER:-${USER}})"
|
MY_USERNAME="$(logname 2> /dev/null || echo ${SUDO_USER:-${USER}})"
|
||||||
|
|
||||||
if command -v gnome-shell &> /dev/null; then
|
if command -v gnome-shell &> /dev/null; then
|
||||||
if (( $(gnome-shell --version | cut -d ' ' -f 3 | cut -d . -f 1) >= 4 )); then
|
if (( $(gnome-shell --version | cut -d ' ' -f 3 | cut -d . -f 1) >= 4 )); then
|
||||||
@ -253,10 +253,10 @@ signal_error() {
|
|||||||
prompt -e "\n\n Oops! Operation failed...\n"
|
prompt -e "\n\n Oops! Operation failed...\n"
|
||||||
prompt -e "=========== ERROR LOG ==========="
|
prompt -e "=========== ERROR LOG ==========="
|
||||||
|
|
||||||
echo -e "${log}"
|
if [[ "${log}" ]] ; then
|
||||||
|
echo -e "${log}"
|
||||||
if [[ ! "${log}" ]] ; then
|
else
|
||||||
prompt -e ">>>>>>> No error log found <<<<<<"
|
prompt -e "\n>>>>>>> No error log found <<<<<<"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
prompt -e "\n =========== ERROR INFO =========="
|
prompt -e "\n =========== ERROR INFO =========="
|
||||||
@ -571,7 +571,7 @@ avoid_variant_duplicates() {
|
|||||||
themes=($(printf "%s\n" "${themes[@]}" | sort -u))
|
themes=($(printf "%s\n" "${themes[@]}" | sort -u))
|
||||||
}
|
}
|
||||||
|
|
||||||
# 'finalize_argument_parsing' is in the 'systems' section
|
# 'finalize_argument_parsing' is in the 'MISC' section
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# FILES #
|
# FILES #
|
||||||
@ -676,7 +676,5 @@ finalize_argument_parsing() {
|
|||||||
[[ "${has_any_error}" == "true" ]] && exit 1 || exit 0
|
[[ "${has_any_error}" == "true" ]] && exit 1 || exit 0
|
||||||
elif [[ "${has_any_error}" == "true" ]]; then
|
elif [[ "${has_any_error}" == "true" ]]; then
|
||||||
echo; prompt -i "Try '$0 --help' for more information."; exit 1
|
echo; prompt -i "Try '$0 --help' for more information."; exit 1
|
||||||
elif [[ "${need_dialog[@]}" =~ "true" ]]; then
|
|
||||||
echo
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -52,8 +52,8 @@ prepare_swupd() {
|
|||||||
local dist=""
|
local dist=""
|
||||||
|
|
||||||
if has_command dnf; then
|
if has_command dnf; then
|
||||||
prompt -w "CLEAR LINUX: You have 'dnf' installed in your system. It may break your system especially when you remove a package"
|
prompt -w "CLEAR LINUX: You have 'dnf' installed in your system. It may break your system especially when you remove a package\n"
|
||||||
confirm remove "CLEAR LINUX: You wanna remove it? (y/n): "
|
confirm remove "CLEAR LINUX: You wanna remove it? (y/n): "; echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! sudo swupd update -y; then
|
if ! sudo swupd update -y; then
|
||||||
@ -90,11 +90,11 @@ install_swupd_packages() {
|
|||||||
prepare_xbps() {
|
prepare_xbps() {
|
||||||
[[ "${xbps_prepared}" == "true" ]] && return 0
|
[[ "${xbps_prepared}" == "true" ]] && return 0
|
||||||
|
|
||||||
# 'xbps-install' requires 'xbps' to be always up-to-date
|
|
||||||
sudo xbps-install -Syu xbps
|
|
||||||
# System upgrading can't remove the old kernel files by it self. It eats the
|
# System upgrading can't remove the old kernel files by it self. It eats the
|
||||||
# boot partition and may cause kernel panic when there is no enough space
|
# boot partition and may cause kernel panic when there is no enough space
|
||||||
sudo vkpurge rm all
|
sudo vkpurge rm all
|
||||||
|
# 'xbps-install' requires 'xbps' to be always up-to-date
|
||||||
|
sudo xbps-install -Syu xbps
|
||||||
|
|
||||||
xbps_prepared="true"
|
xbps_prepared="true"
|
||||||
}
|
}
|
||||||
@ -117,7 +117,9 @@ install_theme_deps() {
|
|||||||
sudo yum install -y sassc glib2-devel gtk-murrine-engine libxml2
|
sudo yum install -y sassc glib2-devel gtk-murrine-engine libxml2
|
||||||
elif has_command pacman; then
|
elif has_command pacman; then
|
||||||
# Rolling release
|
# Rolling release
|
||||||
sudo pacman -Syu --noconfirm --needed sassc glib2 gtk-engine-murrine libxml2
|
# 'Syu' (with a single y) may causes "could not open ... decompression failed"
|
||||||
|
# and "target not found <package>". We got to force 'pacman' to update the repos
|
||||||
|
sudo pacman -Syyu --noconfirm --needed sassc glib2 gtk-engine-murrine libxml2
|
||||||
elif has_command xbps-install; then
|
elif has_command xbps-install; then
|
||||||
# Rolling release
|
# Rolling release
|
||||||
# 'libxml2' is already included here, and it's gonna broke the installation
|
# 'libxml2' is already included here, and it's gonna broke the installation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user