misc-scripts/xbps-clean

17 lines
309 B
Plaintext
Raw Permalink Normal View History

2023-05-03 17:29:22 -05:00
#!/bin/sh
while getopts :d OPT; do
case "$OPT" in
d) DEL=1 ;;
*) echo "invalid option: -$OPTARG" && exit 1 ;;
esac
done
for x in /var/cache/xbps/*.xbps; do
xbps-query "$(xbps-uhelper binpkgver "$x")" 1>/dev/null 2>&1
if [ $? -eq 2 ]; then
echo "${x%.*}"
2023-06-21 17:08:12 -05:00
[ -n "$DEL" ] && rm "${x%.*}".*
2023-05-03 17:29:22 -05:00
fi
done