23 lines
615 B
Text
23 lines
615 B
Text
|
#!/bin/sh
|
||
|
|
||
|
TMP_UPDATES=/tmp/updates_void
|
||
|
|
||
|
[ -d "${TMP_UPDATES}" ] || mkdir "${TMP_UPDATES}"
|
||
|
|
||
|
xbps-install -nuM 1>"${TMP_UPDATES}"/updates 2>"${TMP_UPDATES}"/error
|
||
|
|
||
|
updates="$(awk 'END {print NR}' "${TMP_UPDATES}"/updates)"
|
||
|
broken="$(grep -c broken "${TMP_UPDATES}"/error)"
|
||
|
pkgs="$(awk '{print $1" ---> " $2}' "${TMP_UPDATES}"/updates)"
|
||
|
xx=$(printf "========================================")
|
||
|
|
||
|
if [ "$broken" = 0 ] && [ "$updates" -ge 1 ]; then
|
||
|
herbe "Available updates: $updates" "$xx" "$pkgs"
|
||
|
elif [ "$broken" -ge 1 ]; then
|
||
|
herbe "Broken pkgs:" "$xx" "$(cut -d " " -f 1,5 "${TMP_UPDATES}"/error)"
|
||
|
fi
|
||
|
|
||
|
exit 0
|
||
|
|
||
|
|