mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-02-05 14:12:44 +00:00
abuild: add msg2(), warning2() and error2()
For a second, indented message line.
This commit is contained in:
parent
0a11c5e3c1
commit
2f5545cd61
24
abuild.in
24
abuild.in
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user