index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2017-06-23 13:28:38 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-06-23 13:28:38 +0200 |
commit | 3a92880a3011e29422902a01f3f23fa39aa4497f (patch) | |
tree | 054bed1d26e2eb60bbac07b3cfcdc5521b725f5f /bin | |
parent | 0d87c7936d80abbc271bbd2ef813136ccdf03736 (diff) |
-rwxr-xr-x | bin/sanity-check | 41 |
diff --git a/bin/sanity-check b/bin/sanity-check index 5395466..4700ed9 100755 --- a/bin/sanity-check +++ b/bin/sanity-check @@ -54,13 +54,50 @@ tmp_dir="$(mktemp -d)" trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT if [ $# -eq 0 ]; then - set -- repos package-database state-files + set -- build-list repos package-database state-files fi while [ $# -gt 0 ]; do case "$1" in + build-list) + + [ ${silence} -gt 0 ] || \ + >&2 printf 'sanity-check: checking build-list ...' + + errors="$( + grep -vn '^\S\+ [0-9a-f]\{40\} [0-9a-f]\{40\} \S\+$\|^break_loops$' "${work_dir}/build-list" + )" || true + if [ -n "${errors}" ]; then + if [ ${silence} -le 1 ]; then + echo + echo "The following build orders are wrongly formatted:" + echo "${errors}" + fi + exit 1 + fi + + errors="$( + grep -vxF 'break_loops' "${work_dir}/build-list" | \ + awk '{print $1}' | \ + sort | \ + uniq -d + )" + if [ -n "${errors}" ]; then + if [ ${silence} -le 1 ]; then + echo + echo "The following packages have duplicate build orders:" + echo "${errors}" + fi + exit 1 + fi + + [ ${silence} -gt 0 ] || \ + >&2 echo ' passed.' + + ;; + repos) [ ${silence} -gt 0 ] || \ @@ -218,7 +255,7 @@ while [ $# -gt 0 ]; do *) [ ${silence} -gt 1 ] || \ - >&2 printf 'sanity-check: unknown check "%s".' "$1" + >&2 printf 'sanity-check: unknown check "%s".\n' "$1" exit 2 ;; |