Small bug fixes
This commit is contained in:
19
arch_update
19
arch_update
@@ -54,11 +54,9 @@ while [ $# -gt 0 ]; do
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
# ---------------- Check dependencies ----------------
|
||||
echo -e '\nInstalling dependencies ...' >&2
|
||||
if ! which yay >/dev/null 2>&1; then
|
||||
! which git >/dev/null 2>&1 &&
|
||||
if ! sudo pacman -S --noconfirm git; then
|
||||
@@ -83,20 +81,22 @@ dependencies=
|
||||
! which curl >/dev/null 2>&1 && dependencies="$dependencies curl"
|
||||
[ ! "X$docker_composes" = 'X' ] && ! docker compose >/dev/null 2>&1 && dependencies="$dependencies docker docker-compose"
|
||||
! which git >/dev/null 2>&1 && dependencies="$dependencies git"
|
||||
! which neovim >/dev/null 2>&1 && dependencies="$dependencies neovim"
|
||||
! which pacman-contrib >/dev/null 2>&1 && dependencies="$dependencies pacman-contrib"
|
||||
! which nvim >/dev/null 2>&1 && dependencies="$dependencies neovim"
|
||||
! which paccache >/dev/null 2>&1 && dependencies="$dependencies pacman-contrib"
|
||||
which btrfs >/dev/null 2>&1 && ! which snapper >/dev/null 2>&1 && dependencies="$dependencies snapper"
|
||||
! which yaycache >/dev/null 2>&1 && dependencies="$dependencies yaycache"
|
||||
|
||||
[ ! "X$dependencies" = 'X' ] &&
|
||||
if [ ! "X$dependencies" = 'X' ]; then
|
||||
echo -e '\nInstalling dependencies ...' >&2
|
||||
if ! yay -S --needed --noconfirm $dependencies; then
|
||||
if yay -Syu; then
|
||||
sudo yay -S --noconfirm git
|
||||
yay -S --noconfirm $dependencies
|
||||
else
|
||||
echo -e '\nUnable to fetch package list. Aborting ...' >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
[ ! -e /usr/local/bin/vim ] && sudo ln -s /usr/bin/nvim /usr/local/bin/vim
|
||||
|
||||
@@ -145,9 +145,11 @@ echo -e '\nUpdating system ...' >&2
|
||||
yay -Syu --noconfirm
|
||||
|
||||
# ---------------- Remove orphans ----------------
|
||||
echo -e '\nRemoving orphans ...' >&2
|
||||
orphans=$(yay -Qtdq)
|
||||
[ ! "X$orphans" = 'X' ] && yay -Rns --noconfirm $orphans
|
||||
if [ ! "X$orphans" = 'X' ]; then
|
||||
echo -e '\nRemoving orphans ...' >&2
|
||||
yay -Rns --noconfirm $orphans
|
||||
fi
|
||||
|
||||
# ---------------- Clean cache ----------------
|
||||
echo -e '\nCleaning cache ...' >&2
|
||||
@@ -167,6 +169,7 @@ fi
|
||||
|
||||
# ---------------- Update docker composes ----------------
|
||||
if docker compose >/dev/null 2>&1; then
|
||||
echo -e '\nUpdating docker composes ...' >&2
|
||||
for dir in $docker_composes; do
|
||||
cd $dir
|
||||
docker compose pull
|
||||
|
||||
Reference in New Issue
Block a user