]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add --progress option to test-builds.sh (#618)
authorFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 30 Apr 2020 11:31:11 +0000 (11:31 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 30 Apr 2020 19:26:21 +0000 (19:26 +0000)
Add an option to test-builds.sh to emit dots
to enable tracking progress in the test without
being fully verbose

In the context of the build farm, this will save storage
and bandwidth on the build nodes, while still showing
issues if anything were to occur, and showing whether
progress is being made or a build is stuck.

test-builds.sh

index 4254c4d6390d8b01615cd635c4f70fc675411783..94eeca6b01a0fb7c1a5bda6cff05897cc1c5c150 100755 (executable)
@@ -33,6 +33,10 @@ while [ $# -ge 1 ]; do
        verbose="yes"
        shift
        ;;
+    --progress)
+    verbose="progress"
+    shift
+    ;;
     --keep-going)
        keepGoing="yes"
        shift
@@ -64,11 +68,16 @@ while [ $# -ge 1 ]; do
 done
 
 logtee() {
-    if [ $verbose = yes ]; then
-       tee $1
-    else
-       cat >$1
-    fi
+    case $verbose in
+    yes)
+        tee $1
+        ;;
+    progress)
+        tee $1 | awk '{printf "."; n++; if (!(n % 80)) print "" } END {print ""}'
+        ;;
+    *)
+        cat >$1
+    esac
 }
 
 buildtest() {