This commit is contained in:
pika 2025-05-24 00:59:10 +02:00
parent 3facd6a4d9
commit 8791de659c

View file

@ -478,17 +478,24 @@ update-package-list() {
local USER="${USER:-$(whoami)}" local USER="${USER:-$(whoami)}"
repo::check() { repo::check() {
check "${distro}-repositories up to date" || throw "Error while updating $distro repositories.." check "${distro}-repositories up to date" || upclear
throw "Error while updating $distro repositories.."
} }
case "$distro" in case "$distro" in
ubuntu | debian) ubuntu | debian)
spin bold red "Refreshing $distro sources.." spin bold red "Refreshing $distro sources.."
run $_sudo apt-get update && repo::check if ! run $_sudo apt-get update; then
upclear
throw "Error while updating $distro repositories.."
fi
;; ;;
fedora) fedora)
spin blue bold "Refreshing $distro repositories.." spin blue bold "Refreshing $distro repositories.."
run $_sudo dnf update && repo::check if ! run $_sudo dnf update; then
upclear
throw "Error while updating $distro repositories.."
fi
;; ;;
arch) arch)
if command-exists pacman; then if command-exists pacman; then
@ -531,17 +538,36 @@ update-package-list() {
# sleep 0.01 # sleep 0.01
if command-exists paru; then if command-exists paru; then
run paru -Sy && repo::check if ! run paru -Sy; then
upclear
throw "Error while updating $distro repositories.."
fi
elif command-exists yay; then elif command-exists yay; then
run yay -Sy && repo::check if ! run yay -Sy; then
upclear
throw "Error while updating $distro repositories.."
fi
else else
run $_sudo pacman -Sy && repo::check if ! run $_sudo pacman -Sy; then
upclear
throw "Error while updating $distro repositories.."
fi
fi fi
;; ;;
opensuse) opensuse)
run $_sudo zypper ref && repo::check spin bold green "Refreshing $distro repositories.."
if ! run $_sudo zypper ref; then
upclear
throw "Error while updating $distro repositories.."
fi
;;
alpine)
spin bold blue "Refreshing $distro repositories.."
if ! run $_sudo apk update; then
upclear
throw "Error while updating $distro repositories.."
fi
;; ;;
alpine) run $_sudo apk update && repo::check ;;
*) *)
echo-error "Unsupported distribution: ${BRIGHT_RED}$distro" echo-error "Unsupported distribution: ${BRIGHT_RED}$distro"
return 69 return 69