Commit d9f5462b authored by Linux User's avatar Linux User

use colors on messages

parent e4a3c05d
......@@ -25,20 +25,41 @@ PKGDEST=${PKGDEST:-$startdir}
default_cmds="sanitycheck builddeps clean fetch md5check unpack rootpkg"
#colors
if [ -n "$USE_COLORS" ]; then
NORMAL="\033[1;0m"
STRONG="\033[1;1m"
RED="\033[1;31m"
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
BLUE="\033[1;34m"
fi
# functions
msg() {
local fake="${FAKEROOTKEY:+(fakeroot) }"
local name="${subpkgname:-$pkgname}"
[ -z "$quiet" ] && echo ">>> ${fake}${name}:" "$@" >&2
local prompt="$GREEN>>>${NORMAL}"
local fake="${FAKEROOTKEY:+${BLUE}(fakeroot)${NORMAL} }"
local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
[ -z "$quiet" ] && printf "${prompt} ${fake}${name}: $@\n" >&2
}
warning() {
echo ">>> Warning:" "$@" >&2
local prompt="${YELLOW}>>> WARNING: ${NORMAL}"
local fake="${FAKEROOTKEY:+${BLUE}(fakeroot)${NORMAL} }"
local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
printf "${prompt} ${fake}${name}: $@\n" >&2
}
error() {
local prompt="${RED}>>> ERROR: ${NORMAL}"
local fake="${FAKEROOTKEY:+${BLUE}(fakeroot)${NORMAL} }"
local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
printf "${prompt} ${fake}${name}: $@\n" >&2
}
die() {
quiet=
msg "$@" >&2
error "$@"
exit 1
}
......
......@@ -4,3 +4,6 @@ export CXXFLAGS="$CFLAGS"
export PATH=:/usr/i386-gentoo-linux-uclibc/binutils-bin/2.18:$PATH
export MAKEFLAGS=-j2
# remove line below to disable colors
USE_COLORS=1
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