Those boring never-ending builds...
Can some dualCPU power be spent, if building is interactive (i.e. sent to
terminal), to have them a bit colored?
My last rant about "colored printk()" led away from kernel developers
and their solutions. But now, let me share something.
(maybe some terminal emulators have more colors, finally?) usage:
olecom@flower:/tmp/blinux$ stty -tostop ; mkfifo stdout.pipe stderr.pipe
olecom@flower:/tmp/blinux$ sh ./colorize-linux-build.sh <stdout.pipe &
[1] 22070
olecom@flower:/tmp/blinux$ COLORIZERR=y sh colorize-linux-build.sh <stderr.pipe &
[2] 22145
olecom@flower:/tmp/blinux$
olecom@flower:/tmp/blinux$ LANG=C make >stdout.pipe 2>stderr.pipe
make -C /mnt/zdev0/linux-2.6 O=/dev/shm/blinux/.
Using /mnt/zdev0/linux-2.6 as source for kernel
GEN /dev/shm/blinux/Makefile
CHK include/linux/version.h
CHK include/linux/utsrelease.h
CALL /mnt/zdev0/linux-2.6/scripts/checksyscalls.sh
CHK include/linux/compile.h
VDSOSYM arch/x86/vdso/vdso-syms.lds
VDSOSYM arch/x86/vdso/vdso32-syscall-syms.lds
VDSOSYM arch/x86/vdso/vdso32-sysenter-syms.lds
VDSOSYM arch/x86/vdso/vdso32-syms.lds
LD arch/x86/vdso/built-in.o
CC mm/memory.o
olecom@flower:/tmp/blinux$
make[3]: *** [mm/memory.o] Interrupt
make[2]: *** [mm] Interrupt
make[1]: *** [sub-make] Interrupt
make: *** [all] Interrupt
[1]- Done sh ./colorize-linux-build.sh <stdout.pipe
[2]+ Done COLORIZERR=yes sh colorize-linux-build.sh <stderr.pipe
olecom@flower:/tmp/blinux$
________________________________________________________________________
#!/bin/sh
# colorize linux build
# Time-stamp: Wed Apr 9 13:78:13 CEST 2008 olecom@flower.upol.cRAzY
color() {
# $1 -- regex
# $2 -- color code
# $3 -- next color code (default is $D)
# $4 -- regex match number (s///flags)
printf %s "`eval echo $TERMINAL_OUTPUT`"
}
# for tty
[ -t 1 ] && {
# escape symbol
E=`printf '\033'`
# default fg && bg rendering ; reset attributes
D="7" ; RESET="$E[0m"
# basic attributes (reset bg color and bold, set fg color)
V="$E[40;22;3"
# wrap regex with color ; goto exit
TERMINAL_OUTPUT='{s-"$1"-"$V$2m&$V${3-'$D'}m"-$4 ";" b}'
}
# process stdout
[ -z "$COLORIZERR" ] && {
sed "
/CC/` color CC '6;1'`
/LD/` color LD '2;1'`
/AS/` color AS '5;1'`
/GEN/`color GEN '2;1'`
/UPD/`color UPD '2;1'`
/CHK/`color CHK '3;1'`
/CA/` color CALL '6'`
s-^-${V}2m-
"
printf "$RESET
"
}
# process stderr (once)
while read ERROR
do OUT=$OUT'
'$ERROR
done
printf "\033[1;37;41m$OUT$RESET
"
exit
--
| Christoph Lameter | [04/14] vcompound: Core piece |
| Rafael J. Wysocki | 2.6.24-rc4-git5: Reported regressions from 2.6.23 |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Andrew Morton | Re: 2.6.21-rc2-mm1 |
git: | |
| Ken Pratt | pack operation is thrashing my server |
| Kyle Moffett | Using GIT to store /etc (Or: How to make GIT store all file permission bits) |
| Nicolas Pitre | Re: Cleaning up git user-interface warts |
| Toby White | Using Filemerge.app as a git-diff viewer |
| Richard Stallman | Real men don't attack straw men |
| Peter | OpenBSD as Virtualbox guest |
| Richard Daemon | OpenBSD 4.3 running in VirtualBox? Anyone have it working properly? |
| Mark Zimmerman | alix 2c3 bios version |
| Christoph Hellwig | Re: silent semantic changes with reiser4 |
| Al Boldi | Re: [RFD] Incremental fsck |
| Theodore Tso | Re: [RFC 0/13] extents and 48bit ext3 |
| Josef Jeff Sipek | [PATCH 22 of 23] Unionfs: Unlink |
