fix removing dependency packages

This commit is contained in:
opfez 2021-06-05 14:26:58 +02:00
parent e91d808d5b
commit c493d0b147
1 changed files with 10 additions and 4 deletions

14
pkgtxt
View File

@ -56,11 +56,17 @@ update() {
esac
done
# installing all missing packages
pacman -S --noconfirm $(cat $to_install) 2>/dev/null
# remove all packages to remove
while IFS='' read -r LINE || [ -n "${LINE}" ]; do
if pacman -Qii "$LINE" | grep "^Required By.*None$"; then
pacman -Rs --noconfirm "$LINE"
else
pacman -D --asdeps "$LINE"
fi
done < $to_remove
# removing all packages to remove
pacman -Rs --noconfirm $(cat $to_remove) 2>/dev/null
# install all missing packages
pacman -S --noconfirm $(cat $to_install) 2>/dev/null
remove_tmps