mirror of the now-defunct rocklinux.org
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.

75 lines
2.1 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/misc/output/parse-config
  9. # ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. . misc/output/terminal
  23. output_proc() {
  24. plugins=""
  25. for x in $( ls misc/output ); do
  26. if [ -f misc/output/$x/functions.sh ]; then
  27. eval "y=\$ROCKCFG_OUTPUT_$( echo $x | tr a-z A-Z )"
  28. if [ "$y" = 1 ]; then
  29. . misc/output/$x/functions.sh
  30. plugins="$plugins $x"
  31. fi
  32. fi
  33. done
  34. while read type data; do
  35. for plugin in $plugins; do
  36. eval "echo_${type}_${plugin} $data"
  37. done
  38. done
  39. exit 0
  40. }
  41. if [ -z "$ROCK_OUPUT_PLUGIN_PROC_ACTIVE" ]; then
  42. export ROCK_OUPUT_PLUGIN_PROC_ACTIVE=1
  43. exec 199> >( output_proc )
  44. fi
  45. echo_sched() {
  46. local request="$1" tag
  47. local nl=$'\n' tc="'"
  48. shift
  49. echo_${request}_terminal "$@"
  50. for tag; do
  51. tag=${tag//\\\\/\\\\}
  52. tag=${tag//$tc/\\$tc}
  53. tag=${tag//$nl/\\n}
  54. request="$request \$'$tag'"
  55. done
  56. echo "$request" >&199
  57. }
  58. echo_header() { echo_sched header "$@" ; }
  59. echo_status() { echo_sched status "$@" ; }
  60. echo_error() { echo_sched error "$@" ; }
  61. echo_pkg_deny() { echo_sched pkg_deny "$@" ; }
  62. echo_pkg_start() { echo_sched pkg_start "$@" ; }
  63. echo_pkg_finish() { echo_sched pkg_finish "$@" ; }
  64. echo_pkg_abort() { echo_sched pkg_abort "$@" ; }
  65. echo_errorquote() { echo_sched errorquote "$@" ; }