summaryrefslogtreecommitdiff
path: root/functions.sh
blob: 6dde80cb715077cfc1f58acb65d4b2b0902bbd32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#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}"
	local fake="${FAKEROOTKEY:+${BLUE}(fakeroot)${NORMAL} }"
	local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
	[ -z "$quiet" ] && printf "${prompt} ${fake}${name}: $@\n" >&2
}

warning() {
	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
}