# opkbuild # lib/output.sh # Functions for printing messages. # # Copyright (C) 2012 Patrick "P. J." McDermott # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . [ x"${_OB_OUTPUT_SM+set}" = x'set' ] && return 0 _OB_OUTPUT_SM=1 ob_use locale ob_error() { printf '%s: Error: ' "${0##*/}" >&2 printf "${@}" >&2 printf '\n' >&2 exit 1 } ob_warn() { if [ ${#} -eq 0 ]; then return 125 fi printf '%s: Warning: ' "${0##*/}" >&2 printf "${@}" >&2 printf '\n' >&2 return 0 } ob_info() { if [ ${#} -eq 0 ]; then return 125 fi printf '%s: ' "${0##*/}" >&2 printf "${@}" >&2 printf '\n' >&2 return 0 }