summaryrefslogtreecommitdiff
path: root/bin/build-master-status
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-14 16:11:08 +0200
committerErich Eckner <git@eckner.net>2017-06-14 16:11:08 +0200
commit6c9ef1ccaca1763d6a9e46c71ed9c67f6139c5bc (patch)
treee1d1bf6f08fc8d0c6486bed5590fda3d1f9b3946 /bin/build-master-status
parentf25f9462a68a968a676d555613cdfa6e7516cad1 (diff)
downloadbuilder-6c9ef1ccaca1763d6a9e46c71ed9c67f6139c5bc.tar.xz
remove bashisms - only "bash arrays" and "bash string substituions" left
Diffstat (limited to 'bin/build-master-status')
-rwxr-xr-xbin/build-master-status18
1 files changed, 12 insertions, 6 deletions
diff --git a/bin/build-master-status b/bin/build-master-status
index 85e65f7..ba1dba3 100755
--- a/bin/build-master-status
+++ b/bin/build-master-status
@@ -48,9 +48,9 @@ looped_packages="$(
printf 'The mirror master contains %d stable packages (vs. ca. %d planned).\n' \
"${stable}" \
- "$[${staging}+${testing}+${pending_packages}]"
+ "$((${staging}+${testing}+${pending_packages}))"
printf 'The build list contains %d tasks (incl. broken: %d, leading to %d packages).\n' \
- "$[${tasks}-${broken}]" \
+ "$((${tasks}-${broken}))" \
"${tasks}" \
"${pending_packages}"
printf 'There are %d testing and %d staging packages.\n' \
@@ -63,11 +63,17 @@ if [ "${loops}" -ne 0 ]; then
"${loops}" \
"${looped_packages}"
fi
-if [ $[${broken}+${testing}+${staging}] -ne 0 ]; then
+if [ $((${broken}+${testing}+${staging})) -ne 0 ]; then
printf '%.1f%% of all packages are broken.\n' \
- "$(bc <<< "scale=10; 100*${broken}/(${broken}+${testing}+${staging})")"
+ "$(
+ echo "scale=10; 100*${broken}/(${broken}+${testing}+${staging})" | \
+ bc
+ )"
fi
-if [ $[${testing}+${staging}+${pending_packages}-${broken}] -ne 0 ]; then
+if [ $((${testing}+${staging}+${pending_packages}-${broken})) -ne 0 ]; then
printf '%.1f%% of the planned work has been done.\n' \
- "$(bc <<< "scale=10; 100*(${testing}+${staging})/(${testing}+${staging}+${pending_packages}-${broken})")"
+ "$(
+ echo "scale=10; 100*(${testing}+${staging})/(${testing}+${staging}+${pending_packages}-${broken})" | \
+ bc
+ )"
fi