luca
/
bootstrapper
Archived
1
0
Fork 0
This repository has been archived on 2024-11-21. You can view files and clone it, but cannot push or open issues or pull requests.
bootstrapper/validate.sh

21 lines
538 B
Bash
Executable File

#!/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}"