summaryrefslogtreecommitdiff
path: root/abuild.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-02-13 07:37:06 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-02-13 13:49:25 +0000
commit2f5545cd615ac7dc4a65ca26469e4cbe15ba3b9a (patch)
tree8817bc87c7a1c90ef66018129208238f61933ced /abuild.in
parent0a11c5e3c116b3de00b9b91da9a5b3384b8a8cd6 (diff)
downloadabuild-2f5545cd615ac7dc4a65ca26469e4cbe15ba3b9a.tar.gz
abuild-2f5545cd615ac7dc4a65ca26469e4cbe15ba3b9a.tar.bz2
abuild-2f5545cd615ac7dc4a65ca26469e4cbe15ba3b9a.tar.xz
abuild-2f5545cd615ac7dc4a65ca26469e4cbe15ba3b9a.zip
abuild: add msg2(), warning2() and error2()
For a second, indented message line.
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in24
1 files changed, 20 insertions, 4 deletions
diff --git a/abuild.in b/abuild.in
index e885d03..e01d0fe 100755
--- a/abuild.in
+++ b/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