Commit 5ad23519 authored by Vitaly Lipatov's avatar Vitaly Lipatov

initial support for colorify with csed

parent e1a0702c
......@@ -103,7 +103,7 @@ do
# Note: hasher is already use renice for low priority
showcmd $HSH $HASHERARG --build-args "$BUILDARGS" -- $HASHERDIR $i
($HSH $HASHERARG --build-args "$BUILDARGS" -- $HASHERDIR $i 2>&1 || touch $LOGFILE.failed) | tee -a $LOGFILE
($HSH $HASHERARG --build-args "$BUILDARGS" -- $HASHERDIR $i 2>&1 || touch $LOGFILE.failed) | tee -a $LOGFILE | colorify
test -L $HASHERDIR/BUILD || ln -s chroot/usr/src/RPM/BUILD $HASHERDIR/
if [ -f $LOGFILE.failed ] ; then
RESULT=1
......
......@@ -118,7 +118,7 @@ do
LOGFILE="$LOGDIR/`basename $NAMESRPMIN .src.rpm`$MENVARG.log"
echo "Build in native system" >$LOGFILE
rm -f $LOGFILE.failed
(uni_rpmbuild --commit $i -bb $LISTRPMARGS $NODEPS --target $BUILDARCH 2>&1 || touch $LOGFILE.failed) | tee -a $LOGFILE
(uni_rpmbuild --commit $i -bb $LISTRPMARGS $NODEPS --target $BUILDARCH 2>&1 || touch $LOGFILE.failed) | tee -a $LOGFILE | colorify
[ -r "$LOGFILE.failed" ] && RET=1 || RET=0
if [ "$RET" = "0" ] ; then
......
......@@ -12,14 +12,19 @@ realpath()
readlink -f "$@"
}
colorify()
{
csed '/(warning|предупреждение):/ p magenta,bold' '/(error|ошибка):/ p red,bold'
}
print_message()
{
local DESC="$1"
shift
if [ -z "$TEXTDOMAIN" ] ; then
echo "$DESC in $(basename $0): $@" >&2
echo "$DESC in $(basename $0): $@" | colorify >&2
else
echog "$DESC in $(basename $0): $@" >&2
echog "$DESC in $(basename $0): $@" | colorify >&2
fi
}
......@@ -523,4 +528,3 @@ version_more_version()
{
[ "$2" = "$(echo -e "$1\n$2" | sort -n | head -n1)" ]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment