#!/bin/bash # report about status of build master . "${0%/*}/../conf/default.conf" stable="$( find "${master_mirror_directory}/i686/" \( -name '*testing' -o -name '*staging' \) -prune -o -name '*.pkg.tar.xz' -print | \ wc -l )" tasks="$( wc -l < \ "${work_dir}/build-list" )" staging="$( find "${master_mirror_directory}/i686/"*{testing,staging} -name '*.pkg.tar.xz' | \ wc -l )" broken="$( ls "${work_dir}/package-states/" | \ grep -c '\.broken$' )" loops="$( ls "${work_dir}/build-list.loops" | \ grep -c '^loop_[0-9]\+$' )" looped_packages="$( ls "${work_dir}/build-list.loops" | \ grep '^loop_[0-9]\+$' | \ sed "s|^|${work_dir}/build-list.loops/|" | \ xargs -r cat | \ sort -u | \ wc -l )" printf 'The mirror master contains %d stable packages (vs. ca. %d planned).\n' "${stable}" "$[${staging}+${tasks}]" printf 'The build list contains %d tasks (incl. broken: %d).\n' "$[${tasks}-${broken}]" "${tasks}" printf 'There are %d testing/staging packages.\n' "${staging}" printf 'There are %d broken packages.\n' "${broken}" if [ "${loops}" -ne 0 ]; then printf 'There are %d loops containing %d packages.\n' "${loops}" "${looped_packages}" fi if [ $[${broken}+${staging}] -ne 0 ]; then printf '%.1f%% of all packages are broken.\n' "$(bc <<< "scale=10; 100*${broken}/(${broken}+${staging})")" fi if [ $[${staging}+${tasks}-${broken}] -ne 0 ]; then printf '%.1f%% of the planned work has been done.\n' "$(bc <<< "scale=10; 100*${staging}/(${staging}+${tasks}-${broken})")" fi