dotfiles/dot_local/bin/executable_xxdeps

30 lines
609 B
Bash

#!/bin/sh
_check() {
for p in $(xbps-query -Rx "$1" | cut -d '>' -f1); do
num_child_deps=$(xbps-query -Rx "$p" | wc -l)
update_check_result=$("${XBPS_DISTDIR}"/xbps-src update-check "$p")
if [ "$num_child_deps" -lt 3 ]; then
if [ -n "$update_check_result" ]; then
printf '%s' "$update_check_result" |
while IFS= read -r line; do
for _i in $(seq "$2"); do
printf ' '
done
printf '%s\n' "$line"
done
else
for _i in $(seq "$2"); do
printf ' '
done
printf '%s (latest version)\n' "$p"
fi
_check "$p" "$(($2+1))"
fi
done
}
_check "$1" 0