|
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- # # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # Please add additional copyright information _after_ the line containing # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by # the ./scripts/Create-CopyPatch script. Do not edit this copyright text! # # ROCK Linux: rock-src/misc/output/mythtvosd/functions.sh # ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf # # 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. A copy of the GNU General Public # License can be found at Documentation/COPYING. # # Many people helped and are helping developing ROCK Linux. Please # have a look at http://www.rocklinux.org/ and the Documentation/TEAM # file for details. # # --- ROCK-COPYRIGHT-NOTE-END ---
# first we will construct a universal 'say' function function send_proc() { while read line do while read -t1 subline; do line="$( echo -e "$line\\n$subline" | tail -n10 )" done $ROCKCFG_OUTPUT_MYTHTVOSD_BIN --template=misc/output/mythtvosd/rock.xml \
--host="`hostname`" --msg="$line" 2>&1 > /dev/null done } function send() { if [ -z "$ROCK_OUPUT_PLUGIN_MYTHTVOSD_PROC_ACTIVE" ]; then export ROCK_OUPUT_PLUGIN_MYTHTVOSD_PROC_ACTIVE=1 exec 198> >( send_proc ) fi echo "$*" >&198 }
# A free-form header at start of a section usually followed by calls to # echo_status_terminal(). # echo_header_mythtvosd() { [ $ROCKCFG_OUTPUT_MYTHTVOSD_ENABLE_HEADER -eq 1 ] && send "$*" }
# A free-form status message informaing the user of what is happening just # now. # echo_status_mythtvosd() { [ $ROCKCFG_OUTPUT_MYTHTVOSD_ENABLE_STATUS -eq 1 ] && send "$*" }
# A free-form error or warning message if something fails. # echo_error_mythtvosd() { [ $ROCKCFG_OUTPUT_MYTHTVOSD_ENABLE_ERROR -eq 1 ] && send "$*" }
# We deny to build a package for some reason. # # Usage: echo_pkg_deny <stagelevel> <package-name> <reason> # echo_pkg_deny_mythtvosd() { [ $ROCKCFG_OUTPUT_MYTHTVOSD_ENABLE_PKG_DENY -eq 1 ] && send `eval echo "$ROCKCFG_OUTPUT_MYTHTVOSD_TXT_PKG_DENY"` }
# We start building a package. # # Usage: echo_pkg_start <stagelevel> <repository> <package-name> \ # <ver> <extraver> # echo_pkg_start_mythtvosd() { [ $ROCKCFG_OUTPUT_MYTHTVOSD_ENABLE_PKG_START -eq 1 ] && send `eval echo "$ROCKCFG_OUTPUT_MYTHTVOSD_TXT_PKG_START"` }
# We finished building a package. # # Usage: echo_pkg_finish <stagelevel> <repository> <package-name> # echo_pkg_finish_mythtvosd() { [ $ROCKCFG_OUTPUT_MYTHTVOSD_ENABLE_PKG_FINISH -eq 1 ] && send `eval echo "$ROCKCFG_OUTPUT_MYTHTVOSD_TXT_PKG_FINISH"` }
# We aborted building a package. # # Usage: echo_pkg_abort <stagelevel> <repository> <package-name> # echo_pkg_abort_mythtvosd() { [ $ROCKCFG_OUTPUT_MYTHTVOSD_ENABLE_PKG_ABORT -eq 1 ] && send `eval echo "$ROCKCFG_OUTPUT_MYTHTVOSD_TXT_PKG_ABORT"` }
# Whenever the tail of error logs are printed, this function is used for # that. The parameter may contain newlines. # echo_errorquote_mythtvosd() { [ $ROCKCFG_OUTPUT_MYTHTVOSD_ENABLE_ERRORQUOTE -eq 1 ] && send `eval echo "$ROCKCFG_OUTPUT_MYTHTVOSD_TXT_ERRORQUOTE"` }
|