makepkg: use tput for terminal-safe colored and bold text
Suggested-by: Dan McGee <dan@archlinux.org> Signed-off-by: Cedric Staniewski <cedric@gmx.ca> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
013fc9a795
commit
748bc8ebd4
1 changed files with 7 additions and 7 deletions
|
@ -28,7 +28,7 @@
|
||||||
# makepkg uses quite a few external programs during its execution. You
|
# makepkg uses quite a few external programs during its execution. You
|
||||||
# need to have at least the following installed for makepkg to function:
|
# need to have at least the following installed for makepkg to function:
|
||||||
# bsdtar (libarchive), bzip2, coreutils, fakeroot, find (findutils),
|
# bsdtar (libarchive), bzip2, coreutils, fakeroot, find (findutils),
|
||||||
# getopt (util-linux), gettext, grep, gzip, openssl, sed
|
# getopt (util-linux), gettext, grep, gzip, openssl, sed, tput (ncurses)
|
||||||
|
|
||||||
# gettext initialization
|
# gettext initialization
|
||||||
export TEXTDOMAIN='pacman'
|
export TEXTDOMAIN='pacman'
|
||||||
|
@ -1561,12 +1561,12 @@ fi
|
||||||
# check if messages are to be printed using color
|
# check if messages are to be printed using color
|
||||||
unset ALL_OFF BOLD BLUE GREEN RED YELLOW
|
unset ALL_OFF BOLD BLUE GREEN RED YELLOW
|
||||||
if [ -t 2 -a ! "$USE_COLOR" = "n" -a "$(check_buildenv color)" = "y" ]; then
|
if [ -t 2 -a ! "$USE_COLOR" = "n" -a "$(check_buildenv color)" = "y" ]; then
|
||||||
ALL_OFF="\033[1;0m"
|
ALL_OFF="$(tput sgr0)"
|
||||||
BOLD="\033[1;1m"
|
BOLD="$(tput bold)"
|
||||||
BLUE="${BOLD}\033[1;34m"
|
BLUE="${BOLD}$(tput setaf 4)"
|
||||||
GREEN="${BOLD}\033[1;32m"
|
GREEN="${BOLD}$(tput setaf 2)"
|
||||||
RED="${BOLD}\033[1;31m"
|
RED="${BOLD}$(tput setaf 1)"
|
||||||
YELLOW="${BOLD}\033[1;33m"
|
YELLOW="${BOLD}$(tput setaf 3)"
|
||||||
fi
|
fi
|
||||||
readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
|
readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue