Script to either list all (-a|--all) packages locally installed that are orphaned or only those with pending updates (-o|--outdated).
#!/bin/sh
orphans=$(xbps-query -p maintainer -s orphan | sed 's/-[^-]*:.*//')
case "${1:---all}" in
-a|--all) printf '%s\n' "${orphans}";;
-o|--outdated)
regex=$(printf '%s\n' "${orphans}" | tr '\n' '|' | sed 's;|$;;g')
curl -s "https://repo-default.voidlinux.org/void-updates/void-updates_$(date +%Y-%m-%d).txt" \
| grep -E "^(${regex}) ";;
esac
Script to either list all (
-a|--all) packages locally installed that areorphanedor only those with pending updates (-o|--outdated).