#!/bin/sh # 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" )" pending_packages="$( sed ' s| |.|g s|^|'"${work_dir}"'/package-infos/| s|\.[^.]\+$|.packages| ' "${work_dir}"/build-list | \ xargs -r cat | \ wc -l )" staging="$( find "${master_mirror_directory}/i686/"*staging -name '*.pkg.tar.xz' | \ wc -l )" testing="$( find "${master_mirror_directory}/i686/"*testing -name '*.pkg.tar.xz' | \ wc -l )" broken="$( ls "${work_dir}/package-states/" | \ grep -c '\.broken$' )" || true loops="$( ls "${work_dir}/build-list.loops" | \ grep -c '^loop_[0-9]\+$' )" || true 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}+${testing}+${pending_packages}))" printf 'The build list contains %d tasks (incl. broken: %d, leading to %d packages).\n' \ "$((${tasks}-${broken}))" \ "${tasks}" \ "${pending_packages}" printf 'There are %d testing and %d staging packages.\n' \ "${testing}" \ "${staging}" printf 'There are %d broken package builds.\n' \ "${broken}" if [ "${loops}" -ne 0 ]; then printf 'There are %d loops containing %d package builds.\n' \ "${loops}" \ "${looped_packages}" fi if [ $((${broken}+${testing}+${staging})) -ne 0 ]; then printf '%.1f%% of all packages are broken.\n' \ "$( echo "scale=10; 100*${broken}/(${broken}+${testing}+${staging})" | \ bc )" fi if [ $((${testing}+${staging}+${pending_packages}-${broken})) -ne 0 ]; then printf '%.1f%% of the planned work has been done.\n' \ "$( echo "scale=10; 100*(${testing}+${staging})/(${testing}+${staging}+${pending_packages}-${broken})" | \ bc )" fi