(fix) fix broken pacman installed deps detection mechanism

This commit is contained in:
b1ek 2024-02-14 10:36:03 +10:00
parent b7b536755c
commit c5215c814d
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 23 additions and 12 deletions

View File

@ -157,24 +157,35 @@ if [ "${#PACDEPS[@]}" != "0" ]; then
# first, gotta filter out the ones that are already installed # first, gotta filter out the ones that are already installed
INSTALLED=$(pacman -Qe) INSTALLED=$(pacman -Qe)
TO_INSTALL='' TO_INSTALL=''
removed=0
for pkg in $PACDEPS; do for pkg in $PACDEPS; do
if [[ ! -z $(echo $INSTALLED | grep $pkg) ]]; then if [[ -z $(echo $INSTALLED | grep $pkg) ]]; then
TO_INSTALL="$TO_INSTALL $pkg" TO_INSTALL="$TO_INSTALL $pkg"
else
removed=$(($removed + 1))
fi fi
done done
inf "installing pacman packages:" if ! [ "$removed" == "0" ]; then
inf "$TO_INSTALL" inf "removed $removed installed pacman deps"
fi
# welp lets install those
sudo pacman -S --needed --noconfirm $TO_INSTALL &> $BRICKS_DB/.pacman-log if [ "$TO_INSTALL" != "" ]; then
PACCODE="$?" inf "installing pacman packages:"
if ! [ "$PACCODE" == "0" ]; then inf "$TO_INSTALL"
err "pacman exited with code $PACCODE"
err "pacman's output log is in $BRICKS_DB/.pacman-log" # welp lets install those
exit sudo pacman -S --needed --noconfirm $TO_INSTALL &> $BRICKS_DB/.pacman-log
PACCODE="$?"
if ! [ "$PACCODE" == "0" ]; then
err "pacman exited with code $PACCODE"
err "pacman's output log is in $BRICKS_DB/.pacman-log"
exit
fi
inf "installed all pacman deps"
else
inf "no pacman deps to install"
fi fi
inf "installed all pacman deps"
else else
inf "no pacman deps to install" inf "no pacman deps to install"
fi fi