index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2017-06-19 14:02:39 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-06-19 14:02:39 +0200 |
commit | f4e2e85675b223bf6f75ee07d0a8fd18ffddac64 (patch) | |
tree | 3f3850f190769dbe687cf45a29bb2c7bbdf78895 /bin | |
parent | d1a5996294e279c4f36d4c74d8164ff5af19787d (diff) |
-rwxr-xr-x | bin/build-master-status | 33 |
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 |