Commit 2f5545cd authored by Natanael Copa's avatar Natanael Copa

abuild: add msg2(), warning2() and error2()

For a second, indented message line.
parent 0a11c5e3
......@@ -53,27 +53,43 @@ fi
# functions
msg() {
[ -n "$quiet" ] && return 0
local prompt="$GREEN>>>${NORMAL}"
local fake="${FAKEROOTKEY:+${BLUE}*${NORMAL}}"
local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
[ -z "$quiet" ] && printf "${prompt} ${name}${fake}: $@\n" >&2
printf "${prompt} ${name}${fake}: %s\n" "$1" >&2
}
msg2() {
[ -n "$quiet" ] && return 0
# ">>> %s"
printf " %s\n" "$1" >&2
}
warning() {
local prompt="${YELLOW}>>> WARNING:${NORMAL}"
local fake="${FAKEROOTKEY:+${BLUE}*${NORMAL}}"
local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
printf "${prompt} ${name}${fake}: $@\n" >&2
printf "${prompt} ${name}${fake}: %s\n" "$1" >&2
}
warning2() {
# ">>> WARNING:
printf " %s\n" "$1" >&2
}
error() {
local prompt="${RED}>>> ERROR:${NORMAL}"
local fake="${FAKEROOTKEY:+${BLUE}*${NORMAL}}"
local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
printf "${prompt} ${name}${fake}: $@\n" >&2
printf "${prompt} ${name}${fake}: %s\n" "$1" >&2
}
error2() {
# ">>> ERROR:
printf " %s\n" "$1" >&2
}
set_xterm_title() {
if [ "$TERM" = xterm ] && [ -n "$USE_COLORS" ]; then
printf "\033]0;$1\007" >&2
......
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