fix remove cache loop

This commit is contained in:
Tobias Powalowski 2022-05-14 17:08:11 +02:00
parent 34f707711d
commit da12ceaa84

View file

@ -238,14 +238,8 @@ _cleanup_install() {
} }
_cleanup_x_cache() { _cleanup_x_cache() {
# get last full package
LAST_FULL_PACKAGE="$(grep 'FULL' /etc/archboot/defaults | sed -e 's#^.*\ ##g' -e 's#\"##g')"
# installed packages
grep 'installed' /var/log/pacman.log | cut -d ' ' -f 4 >/tmp/installed.log
# remove all lines above with match
sed -i -e "1,/^${LAST_FULL_PACKAGE}$/d" /tmp/installed.log
# remove packages from cache # remove packages from cache
while read -r /tmp/installed.log; do for i in $(grep -w 'installed' /var/log/pacman.log | cut -d ' ' -f 4); do
rm -rf /var/cache/pacman/pkg/"${i}"-* rm -rf /var/cache/pacman/pkg/"${i}"-*
done done
} }