Add a wrapper around `make`
For building Linux kernels. I pipe the output to a colorizing script to add some nice colors to the build. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
1a5f6eb872
commit
730d42ee7f
|
@ -0,0 +1,21 @@
|
||||||
|
import sys
|
||||||
|
import termcolor
|
||||||
|
import re
|
||||||
|
|
||||||
|
def colorize(line, pattern, color=None, attrs=None):
|
||||||
|
if (match := re.search(f"({pattern})", line)):
|
||||||
|
return re.sub(pattern, termcolor.colored(match[0], color, attrs=attrs), line)
|
||||||
|
return line
|
||||||
|
|
||||||
|
for line in sys.stdin:
|
||||||
|
line = colorize(line, "^ C[\w]*", "green")
|
||||||
|
line = colorize(line, "^ ZSTD", "green")
|
||||||
|
line = colorize(line, "^ SIGN", "cyan")
|
||||||
|
line = colorize(line, "^ INSTALL", "yellow")
|
||||||
|
line = colorize(line, "^ LD", "yellow")
|
||||||
|
line = colorize(line, " \[M\] ", "magenta")
|
||||||
|
line = colorize(line, "[\w/-]+\.k?o", attrs=["bold"])
|
||||||
|
line = colorize(line, "^#(.*)", "cyan")
|
||||||
|
line = colorize(line, "^Kernel(.*)$", attrs=["bold"])
|
||||||
|
|
||||||
|
print(line, end="")
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
|
let jobs=$(nproc)-2
|
||||||
|
make -j$jobs $* | python /home/anna/bin/colorize.py
|
Loading…
Reference in New Issue