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.

94 lines
2.7 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/html/functions.sh
  9. # ROCK Linux is Copyright (C) 1998 - 2003 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. mkdir -p $ROCKCFG_OUTPUT_HTML_DIR
  23. html_color_normal=000000
  24. html_color_error=ff5552
  25. html_color_status=52ff52
  26. html_color_header=ff55ff
  27. echo_html_raw() {
  28. echo -n "$*" >> $ROCKCFG_OUTPUT_HTML_DIR/index.html
  29. }
  30. echo_html_text() {
  31. echo -n "<tt><font color=$1>$2</font></tt>" >> $ROCKCFG_OUTPUT_HTML_DIR/index.html
  32. }
  33. echo_html_newline() {
  34. echo "&nbsp;<br>" >> $ROCKCFG_OUTPUT_HTML_DIR/index.html
  35. }
  36. echo_header_html() {
  37. echo_html_newline
  38. echo_html_text ${html_color_header} "$*"
  39. echo_html_newline
  40. }
  41. echo_status_html() {
  42. echo_html_text ${html_color_status} "-> "
  43. echo_html_text ${html_color_normal} "$*"
  44. echo_html_newline
  45. }
  46. echo_error_html() {
  47. echo_html_text ${html_color_error} "!> $*"
  48. echo_html_newline
  49. }
  50. echo_pkg_deny_html() {
  51. echo_html_newline
  52. echo_html_text ${html_color_error} "$( date "+== %D %T =[$1]=> Package $2 $3." )"
  53. echo_html_newline
  54. }
  55. echo_pkg_start_html() {
  56. echo_html_newline
  57. echo_html_text ${html_color_header} "$( date "+== %T =[$1]=> Building $2/$3 [$4 $5]." )"
  58. echo_html_newline
  59. }
  60. echo_pkg_finish_html() {
  61. echo_html_text ${html_color_header} "$( date "+== %D %T =[$1]=> Finished building package $3." )"
  62. # local tm=$( date '+%s' )
  63. # cp $root/var/adm/logs/$1-$3.log $ROCKCFG_OUTPUT_HTML_DIR/$1-$3-$tm.txt
  64. # echo_html_raw " &nbsp; <b>[<a href=\"$1-$3-$tm.txt\">logfile</a>]</b>"
  65. echo_html_newline
  66. }
  67. echo_pkg_abort_html() {
  68. echo_html_text ${html_color_error} "$( date "+== %D %T =[$1]=> Aborted building package $3." )"
  69. # local tm=$( date '+%s' )
  70. # cp $root/var/adm/logs/$1-$3.err $ROCKCFG_OUTPUT_HTML_DIR/$1-$3-$tm.txt
  71. # echo_html_raw " &nbsp; <b>[<a href=\"$1-$3-$tm.txt\">logfile</a>]</b>"
  72. echo_html_newline
  73. }
  74. echo_errorquote_html() {
  75. echo "$*" | grep . | while read line; do
  76. echo_html_text ${html_color_error} "!> "
  77. echo_html_text ${html_color_normal} "$line"
  78. echo_html_newline
  79. done
  80. }