Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-19 14:02:39 +0200
committerErich Eckner <git@eckner.net>2017-06-19 14:02:39 +0200
commitf4e2e85675b223bf6f75ee07d0a8fd18ffddac64 (patch)
tree3f3850f190769dbe687cf45a29bb2c7bbdf78895 /bin
parentd1a5996294e279c4f36d4c74d8164ff5af19787d (diff)
bin/build-master-status: -o $output new
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build-master-status33
1 files changed, 26 insertions, 7 deletions
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