nice make clean 2>&1 > $LOG
+function tee_color_split()
+{
+ while read; do
+ echo -e $REPLY | ./scripts/skip-colors >> $LOG
+ echo -e $REPLY
+ done
+}
+
+function log_try_kernel()
+{
+ echo -en "Trying kernel ${BLUE}"
+ printf "%40s\t" "${1}"
+ echo -en "${NORMAL}"
+}
+
for i in $KLIBS; do
KERNEL=$(basename $i)
DIR=${i}/build/
continue
fi
- echo -en "Trying kernel ${BLUE}" | tee -a $LOG
- printf "%40s\t" "${KERNEL}" | tee -a $LOG
- echo -en "${NORMAL}" | tee -a $LOG
+ # We cannot use tee_color_split() as bash read only spits
+ # out output when a newline comes in. We can modif IFS but
+ # I am still not sure how to do this properly.
+ log_try_kernel $KERNEL | ./scripts/skip-colors >> $LOG
+ log_try_kernel $KERNEL
ionice -c 3 nice -n 20 make KLIB=$DIR KLIB_BUILD=$DIR -j6 -Wunused-but-set-variable &>> $LOG
if [[ $? -eq 0 ]]; then
- echo -e "${GREEN}[OK]${NORMAL}" | tee -a $LOG
+ echo -e "${GREEN}[OK]${NORMAL}" | tee_color_split
else
- echo -e "${RED}[FAILED]${NORMAL}" | tee -a $LOG
+ echo -e "${RED}[FAILED]${NORMAL}" | tee_color_split
fi
nice make clean KLIB=$DIR KLIB_BUILD=$DIR 2>&1 >> $LOG
done
-
-cat $LOG | ./scripts/skip-colors > $LOG.tmp
-mv $LOG.tmp $LOG