wip
This commit is contained in:
parent
3facd6a4d9
commit
8791de659c
1 changed files with 34 additions and 8 deletions
42
dream.sh
42
dream.sh
|
@ -478,17 +478,24 @@ update-package-list() {
|
|||
local USER="${USER:-$(whoami)}"
|
||||
|
||||
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
|
||||
ubuntu | debian)
|
||||
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)
|
||||
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)
|
||||
if command-exists pacman; then
|
||||
|
@ -531,17 +538,36 @@ update-package-list() {
|
|||
# sleep 0.01
|
||||
|
||||
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
|
||||
run yay -Sy && repo::check
|
||||
if ! run yay -Sy; then
|
||||
upclear
|
||||
throw "Error while updating $distro repositories.."
|
||||
fi
|
||||
else
|
||||
run $_sudo pacman -Sy && repo::check
|
||||
if ! run $_sudo pacman -Sy; then
|
||||
upclear
|
||||
throw "Error while updating $distro repositories.."
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
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"
|
||||
return 69
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue