makepkg does not contain logic to react if a terminal capability is
present when another one in the list dictated by the wrapping
conditional is not.

This commit makes it a benign condition; e.g., if the tput probing chunk
determines that makepkg is to fallback to using standout and reverse
capabilities, it will make the best use of what it can find, instead of
abruptly ending the program.

Signed-off-by: Carlos Diaz <839...@gmail.com>
---
 scripts/makepkg.sh.in |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 6a5cff8..866b995 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1659,6 +1659,8 @@ PACMAN=${PACMAN:-pacman}
 
 # check if messages are to be printed using color
 unset ALL_OFF BOLD BLUE GREEN RED YELLOW
+# do not abort when a terminal capability is unpresent
+set +E +e
 if [[ -t 2 && ! $USE_COLOR = "n" && $(check_buildenv color) = "y" ]]; then
        if tput setaf 0 &>/dev/null; then
                # tput linked against a compliant terminfo ncurses
@@ -1686,6 +1688,7 @@ if [[ -t 2 && ! $USE_COLOR = "n" && $(check_buildenv 
color) = "y" ]]; then
                YELLOW="$(tput mh)"  # half-bright
        fi
 fi
+set -E -e
 readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
 
 # override settings with an environment variable for batch processing
-- 
1.7.3.1


Reply via email to