abuild/functions.sh

35 lines
805 B
Bash
Raw Normal View History

2009-01-03 10:05:12 +00:00
#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 prompt="$GREEN>>>${NORMAL}"
2009-01-26 13:32:44 +00:00
local fake="${FAKEROOTKEY:+${BLUE}*${NORMAL}}"
2009-01-03 10:05:12 +00:00
local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
2009-01-26 13:32:44 +00:00
[ -z "$quiet" ] && printf "${prompt} ${name}${fake}: $@\n" >&2
2009-01-03 10:05:12 +00:00
}
warning() {
2009-01-26 13:32:44 +00:00
local prompt="${YELLOW}>>> WARNING:${NORMAL}"
local fake="${FAKEROOTKEY:+${BLUE}*${NORMAL}}"
2009-01-03 10:05:12 +00:00
local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
2009-01-26 13:32:44 +00:00
printf "${prompt} ${name}${fake}: $@\n" >&2
2009-01-03 10:05:12 +00:00
}
error() {
2009-01-26 13:32:44 +00:00
local prompt="${RED}>>> ERROR:${NORMAL}"
local fake="${FAKEROOTKEY:+${BLUE}*${NORMAL}}"
2009-01-03 10:05:12 +00:00
local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
2009-01-26 13:32:44 +00:00
printf "${prompt} ${name}${fake}: $@\n" >&2
2009-01-03 10:05:12 +00:00
}