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