From 5a6676edfa4e46c0c4d41b7eebfeb5c395a9cdaf Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 18 Oct 2017 14:54:59 +0200 Subject: bin/build-master-status: add guess for reason of failed build to broken-packages website --- bin/build-master-status | 53 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) (limited to 'bin/build-master-status') diff --git a/bin/build-master-status b/bin/build-master-status index 1dc9e62..5940cd5 100755 --- a/bin/build-master-status +++ b/bin/build-master-status @@ -261,6 +261,40 @@ if ${web}; then tac > \ "${tmp_dir}/statistics" + find "${build_log_directory}/error" -maxdepth 1 -type f -name '*.build-log.gz' \( \ + \( \ + -exec zgrep -q '^==> ERROR: A failure occurred in build()\.$' {} \; \ + -printf '%f build()\n' \ + \) -o \ + \( \ + -exec zgrep -q '^==> ERROR: A failure occurred in check()\.$' {} \; \ + -printf '%f check()\n' \ + \) -o \ + \( \ + -exec zgrep -q '^==> ERROR: Could not download sources\.$' {} \; \ + -printf '%f source\n' \ + \) -o \ + \( \ + -exec zgrep -q 'error: failed to commit transaction (invalid or corrupted package)$' {} \; \ + -printf '%f package-cache\n' \ + \) -o \ + -printf '%f unknown\n' \ + \) | \ + sed ' + s|\(\.[^.]\+\)\{3\} | | + ' | \ + sort -u | \ + sed ' + :a + $!N + s/^\(\S\+\) \([^\n]\+\)\n\1 /\1 \2,/ + ta + P + D + ' | \ + sort -k1,1 > \ + "${tmp_dir}/broken-packages.reason" + { printf '%s\n' \ '' \ @@ -279,12 +313,15 @@ if ${web}; then 'package repository' \ 'compilations' \ 'dependent' \ + 'build error' \ 'blocked' printf '\n' find "${work_dir}/package-states" -maxdepth 1 -name '*.broken' -printf '%f\n' | \ sed 's|\.broken$||' | \ - sed 's|^\(\(.\+\)\.\([^.]\+\)\.\([^.]\+\)\.\([^.]\+\)\)$|\1 \2 \3 \4 \5|' | \ - while read -r sf pkg rev mod_rev repo; do + sort -k1,1 | \ + join -j 1 - "${tmp_dir}/broken-packages.reason" | \ + sed 's|^\(\(.\+\)\.\([^.]\+\)\.\([^.]\+\)\.\([^.]\+\)\) \(\S\+\)$|\1 \2 \3 \4 \5 \6|' | \ + while read -r sf pkg rev mod_rev repo build_error; do if grep -qxF "${pkg}" "${tmp_dir}/broken-packages-names"; then printf '1 ' else @@ -307,7 +344,8 @@ if ${web}; then echo 'x  ' ) | \ cut -d' ' -f2 - )" + )" \ + "${build_error}" if [ -f "${work_dir}/package-states/${sf}.blocked" ]; then while read -r blocked_reason; do if echo "${blocked_reason}" | \ @@ -350,7 +388,7 @@ if ${web}; then printf '\n' done | \ sort -k6n,6 | \ - while read -r buildable pkg rev mod_rev repo count log_file dependent reason; do + while read -r buildable pkg rev mod_rev repo count log_file dependent build_error reason; do if [ "${buildable}" -eq 0 ]; then left='(' right=')' @@ -362,6 +400,10 @@ if ${web}; then if git -C "${repo_paths__archlinux32}" archive "${mod_rev}" -- "${repo}/${pkg}/PKGBUILD" > /dev/null 2>&1; then mod_rev="${mod_rev}" fi + build_error=$( + echo "${build_error}" | \ + sed 's|,|, |g' + ) printf '%s' \ ''"${left}${pkg}${right}"'' \ "${rev}" \ @@ -369,6 +411,7 @@ if ${web}; then "${repo}" \ ''"${count}"'' \ "${dependent}" \ + "${build_error}" \ "${reason}" printf '\n' done @@ -379,7 +422,7 @@ if ${web}; then } > \ "${tmp_dir}/broken-packages.html" - rm -f "${tmp_dir}/broken-packages-names" + rm -f "${tmp_dir}/broken-packages-names" "${tmp_dir}/broken-packages.reason" { printf '%s\n' \ -- cgit v1.2.3-70-g09d2