Compare commits
2 Commits
2948409f27
...
c5215c814d
Author | SHA1 | Date |
---|---|---|
b1ek | c5215c814d | |
b1ek | b7b536755c |
21
brick.sh
21
brick.sh
|
@ -157,18 +157,35 @@ if [ "${#PACDEPS[@]}" != "0" ]; then
|
|||
# first, gotta filter out the ones that are already installed
|
||||
INSTALLED=$(pacman -Qe)
|
||||
TO_INSTALL=''
|
||||
removed=0
|
||||
for pkg in $PACDEPS; do
|
||||
if [[ ! -z $(echo $INSTALLED | grep $pkg) ]]; then
|
||||
if [[ -z $(echo $INSTALLED | grep $pkg) ]]; then
|
||||
TO_INSTALL="$TO_INSTALL $pkg"
|
||||
else
|
||||
removed=$(($removed + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
if ! [ "$removed" == "0" ]; then
|
||||
inf "removed $removed installed pacman deps"
|
||||
fi
|
||||
|
||||
if [ "$TO_INSTALL" != "" ]; then
|
||||
inf "installing pacman packages:"
|
||||
inf "$TO_INSTALL"
|
||||
|
||||
# welp lets install those
|
||||
sudo pacman -S --needed --noconfirm $TO_INSTALL
|
||||
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
|
||||
else
|
||||
inf "no pacman deps to install"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue