From f4e2e85675b223bf6f75ee07d0a8fd18ffddac64 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 19 Jun 2017 14:02:39 +0200 Subject: bin/build-master-status: -o $output new --- bin/build-master-status | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/build-master-status b/bin/build-master-status index ab052be..9330afe 100755 --- a/bin/build-master-status +++ b/bin/build-master-status @@ -4,6 +4,18 @@ . "${0%/*}/../conf/default.conf" +if [ "x$1" = "x-o" ]; then + output_file="$2" + output() { + cat >> "${output_file}" + } + : > "$2" +else + output() { + cat + } +fi + stable="$( ${master_mirror_command} "${master_mirror_directory}/i686/" | \ awk '{print $5}' | \ @@ -63,32 +75,39 @@ looped_packages="$( printf 'The mirror master contains %d stable packages (vs. ca. %d planned).\n' \ "${stable}" \ - "$((${staging}+${testing}+${pending_packages}))" + "$((${staging}+${testing}+${pending_packages}))" | \ + output printf 'The build list contains %d tasks (incl. broken: %d, leading to %d packages).\n' \ "$((${tasks}-${broken}))" \ "${tasks}" \ - "${pending_packages}" + "${pending_packages}" | \ + output printf 'There are %d testing and %d staging packages.\n' \ "${testing}" \ - "${staging}" + "${staging}" | \ + output printf 'There are %d broken package builds.\n' \ - "${broken}" + "${broken}" | \ + output if [ "${loops}" -ne 0 ]; then printf 'There are %d loops containing %d package builds.\n' \ "${loops}" \ - "${looped_packages}" + "${looped_packages}" | \ + output 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 - )" + )" | \ + output 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 - )" + )" | \ + output fi -- cgit v1.2.3-70-g09d2