OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

81 lines
2.4 KiB

# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: lib/output/parse-config
# Copyright (C) 2006 - 2008 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
# Copyright (C) 1998 - 2003 Clifford Wolf
#
# More information can be found in the files COPYING and README.
#
# 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; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
. lib/output/terminal
output_proc() {
columns=$1
plugins=
for x in $( ls lib/output ); do
if [ -f lib/output/$x/functions.sh ]; then
eval "y=\$SDECFG_OUTPUT_$( echo $x | tr a-z A-Z )"
if [ "$y" = 1 ]; then
. lib/output/$x/functions.sh
plugins="$plugins $x"
fi
fi
done
while read -r type data; do
# always output to the terminal
for plugin in terminal $plugins; do
eval "echo_${type}_${plugin} $data"
done
done
exit 0
}
if [ -z "$SDE_OUPUT_PLUGIN_PROC_ACTIVE" ]; then
export SDE_OUPUT_PLUGIN_PROC_ACTIVE=1
# since the output plugin's stdin is the pipe, we help it out
# with the columns for pretty printing output
[ "${columns:=$COLUMNS}" ] || columns="$( stty size 2> /dev/null | cut -d' ' -f2 )"
[ "$columns" ] || columns=80
exec 199> >( output_proc $columns )
fi
echo_sched() {
local request="$1" tag ; shift
local nl=$'\n' tc="'"
# only for Build-Target, we want to duplication
# the terminal output, on the log file at fd/201
[ ! -e /proc/self/fd/201 ] ||
echo_${request}_terminal "$@" >&201
# add each argument, seperated in quotes, after newlines and
# tick quotes got escaped
for tag; do
tag=${tag//\\\\/\\\\}
tag=${tag//$tc/\\$tc}
tag=${tag//$nl/\\n}
request="$request \$'$tag'"
done
echo "$request" >&199
}
echo_header() { echo_sched header "$@" ; }
echo_status() { echo_sched status "$@" ; }
echo_warning() { echo_sched warning "$@" ; }
echo_error() { echo_sched error "$@" ; }
echo_pkg_deny() { echo_sched pkg_deny "$@" ; }
echo_pkg_start() { echo_sched pkg_start "$@" ; }
echo_pkg_finish() { echo_sched pkg_finish "$@" ; }
echo_pkg_abort() { echo_sched pkg_abort "$@" ; }
echo_errorquote() { echo_sched errorquote "$@" ; }