From: Mark Andrews Date: Wed, 4 Oct 2017 08:18:56 +0000 (+1100) Subject: test for 'printf' X-Git-Tag: v9.12.0b1~96 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d1e823af1513e70c8999c59577653dc39ec18895;p=thirdparty%2Fbind9.git test for 'printf' --- diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in index 61df6750d5e..65192a54c22 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in @@ -153,21 +153,34 @@ else COLOR_NONE='' fi -echofail () { - printf "${COLOR_FAIL}%s${COLOR_NONE}\n" "$*" -} - -echowarn () { - printf "${COLOR_WARN}%s${COLOR_NONE}\n" "$*" -} - -echopass () { - printf "${COLOR_PASS}%s${COLOR_NONE}\n" "$*" -} - -echoinfo () { - printf "${COLOR_INFO}%s${COLOR_NONE}\n" "$*" -} +if type printf > /dev/null 2>&1 +then + echofail () { + printf "${COLOR_FAIL}%s${COLOR_NONE}\n" "$*" + } + echowarn () { + printf "${COLOR_WARN}%s${COLOR_NONE}\n" "$*" + } + echopass () { + printf "${COLOR_PASS}%s${COLOR_NONE}\n" "$*" + } + echoinfo () { + printf "${COLOR_INFO}%s${COLOR_NONE}\n" "$*" + } +else + echofail () { + echo "$*" + } + echowarn () { + echo "$*" + } + echopass () { + echo "$*" + } + echoinfo () { + echo "$*" + } +fi # # Export command paths