1
0
Fork 0
bootstrapper/validate.sh

21 lines
538 B
Bash
Raw Normal View History

#!/bin/sh
info() {
printf "%b\n" "${1}"
}
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
skip_regex="^(#.*)?$"
total=$(grep -cvP "$skip_regex" "${SCRIPT_DIR}/packages.txt")
tput sc
while read -r package; do
echo "$package" | grep -qvP "$skip_regex" || continue
n=$((n + 1))
eval "info \"(${n}/${total}) Validating $package\""
xbps-query -R "$package" >/dev/null 2>&1 || failed_packages="${failed_packages} ${package}"
tput rc
tput el
done <"${SCRIPT_DIR}/packages.txt"
echo "Failed packages:${failed_packages}"