]> git.eshelyaron.com Git - emacs.git/commitdiff
Further improvements to admin/emake.
authorGregory Heytings <gregory@heytings.org>
Sat, 17 Sep 2022 09:36:38 +0000 (09:36 +0000)
committerGregory Heytings <gregory@heytings.org>
Sat, 17 Sep 2022 09:37:51 +0000 (11:37 +0200)
* admin/emake: Better parsing of script options.  Add a --quieter option,
which removes everything except errors.

admin/emake

index db4363a25bf0a04286596f5a0b5fea5226e5c499..e2f38501e93e5e97d25e4bfd102323c2a73a8015 100755 (executable)
@@ -20,9 +20,18 @@ if [ -f /proc/cpuinfo ]; then
        sed 's/^[0-9]*/+/')))
 fi
 
-[[ "X$1" == "X--no-color" ]] && { NOCOLOR=1; shift; } || NOCOLOR=0
-[[ "X$1" == "X--no-check" ]] && { NOCHECK=1; shift; } || NOCHECK=0
-[[ "X$1" == "X--no-fast" ]] && { FASTOPT=""; shift; } || FASTOPT="FAST=true"
+NOCOLOR=0
+NOCHECK=0
+FASTOPT="FAST=true"
+QUIETER=0
+while :
+do
+    [[ "X$1" == "X--no-color" ]] && { NOCOLOR=1; shift; continue; }
+    [[ "X$1" == "X--no-check" ]] && { NOCHECK=1; shift; continue; }
+    [[ "X$1" == "X--no-fast" ]] && { FASTOPT=""; shift; continue; }
+    [[ "X$1" == "X--quieter" ]] && { QUIETER=1; shift; continue; }
+    break
+done
 
 make $FASTOPT -j$cores "$@" 2>&1 | \
 sed -u 's# \.\./\.\./# #
@@ -106,7 +115,12 @@ do
   C=""
   (($NOCOLOR == 0)) && [[ "X${REPLY:0:1}" != "X " ]] && C="\033[1;31m"
   (($NOCOLOR == 0)) && [[ "X${REPLY:0:3}" == "X   " ]] && C="\033[1;31m"
-  [[ "X$C" == "X" ]] && printf "%s\n" "$REPLY" || printf "$C%s\033[0m\n" "$REPLY"
+  if (($QUIETER == 0))
+  then
+      [[ "X$C" == "X" ]] && printf "%s\n" "$REPLY" || printf "$C%s\033[0m\n" "$REPLY"
+  else
+      [[ "X$C" == "X" ]] && printf "%-80s\r" "$REPLY" || printf "$C%-80s\033[0m\n" "$REPLY"
+  fi
 done
 
 # If make failed, exit now with its error code.