Skip to content

Instantly share code, notes, and snippets.

@nicman23
Created January 12, 2019 14:36
Show Gist options
  • Save nicman23/756ddc8543ce04be41ea1900f786fc59 to your computer and use it in GitHub Desktop.
Save nicman23/756ddc8543ce04be41ea1900f786fc59 to your computer and use it in GitHub Desktop.
paccheck checking only the existance and size of the the reported files, going to the next package on first error.
#! /usr/bin/bash
pacman -Qsq | while read line;
do echo \> checking $line; pacman -Qlq $line | grep -vP '^/etc' | grep -vP '/$' |
while read line2
do if [[ ! -e "$line2" ]] && [[ ! -s "$line2" ]]
then echo $line $line2 | tee -a corrupt; break
fi
done
done
echo Now run 'xargs pacman -S <<< "$(cut -d "\' \'" -f 1 corrupt)"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment