slitaz-dev-tools diff libtaz/libtaz-modules/report @ rev 103
tazwikiss: add wkp_Upload.sh
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jun 01 16:03:21 2011 +0200 (2011-06-01) |
parents | 81157fb10757 |
children | b571aa2a37b0 |
line diff
1.1 --- a/libtaz/libtaz-modules/report Fri Feb 25 23:23:01 2011 +0100 1.2 +++ b/libtaz/libtaz-modules/report Wed Jun 01 16:03:21 2011 +0200 1.3 @@ -1,7 +1,7 @@ 1.4 1.5 # Usage : use_report functions/commands 1.6 # 'use_report' execute functions/commands and redirect the output. 1.7 -# You can use 'report' function to display message, steps, blocs and 1.8 +# You can use 'report' function to display messages, steps, blocs and 1.9 # status in the terminal and organize the display of the log. 1.10 1.11 report_verbosity_opt=all 1.12 @@ -66,7 +66,7 @@ 1.13 report_pid=$$ 1.14 fi 1.15 1.16 - # Use the default logfile if there's no logfile was specified by the main script. 1.17 + # Use the default logfile if no logfile was specified by the main script. 1.18 [ ! "$log_opt" ] && [ "$report_log_all" = yes ] && \ 1.19 log_opt="$SLITAZ_LOG/`basename $0`/$(date -Iseconds).html" 1.20 export report_pid log_opt 1.21 @@ -88,7 +88,7 @@ 1.22 echo "[--------------------------/!\ DEBUG MODE ENABLED /!\--------------------------]" 1.23 fi 1.24 1.25 - # Theses variable are used to configure the display of steps in terminal. 1.26 + # Theses variable are used to configure the display of steps in a terminal. 1.27 bloc1_delimiter="================================================================================" 1.28 bloc1_display=" " 1.29 bloc2_delimiter="----------------------------------------------------------------------------" 1.30 @@ -99,7 +99,7 @@ 1.31 # Use a trap to exit cleanly if app is killed. 1.32 trap "report_exit $(basename $0) killed by user" SIGINT SIGTERM 1.33 1.34 - # Use another display function if quiet is enable. 1.35 + # Use another display function if quiet is enabled. 1.36 [ "$report_verbosity_opt" = "none" ] && report_display() 1.37 { 1.38 while read out; do 1.39 @@ -165,7 +165,7 @@ 1.40 fi 1.41 } 1.42 1.43 -# Use this to stop a program with error. 1.44 +# Use this to stop a program with an error. 1.45 report_exit() 1.46 { 1.47 # Log&display error message. 1.48 @@ -187,12 +187,12 @@ 1.49 1.50 # Usage : report [command] [message] 1.51 # 1.52 -# type :message - simply display the message. 1.53 -# step - name the step and display status when ended. 1.54 -# end-step - display status of the step, it's done automaticaly when 1.55 -# starting a new step, closing a bloc or stop report. 1.56 -# open-bloc - open the list of steps in the operation; 1.57 -# close-bloc- close the current bloc. 1.58 +# type :message simply display the message. 1.59 +# step name the step and display status when ended. 1.60 +# end-step display status of the step, it's done automatically when 1.61 +# starting a new step, closing a bloc or stopping a report. 1.62 +# open-bloc open the list of steps in the operation. 1.63 +# close-bloc close the current bloc. 1.64 report() 1.65 { 1.66 # First : get status before it is changed by other commands. 1.67 @@ -289,7 +289,7 @@ 1.68 return $report_return_code 1.69 } 1.70 1.71 -# Open a bloc of substeps in terminal and log. 1.72 +# Open a bloc of substeps in a terminal and log. 1.73 report_open_bloc() 1.74 { 1.75 unset open_bloc 1.76 @@ -317,17 +317,17 @@ 1.77 unset step_running 1.78 } 1.79 1.80 -# This is the two new status function used by the report tool. 1.81 +# These are the two new status functions used by the report tool. 1.82 # States are : ok - no error since the start of the step 1.83 -# warning - there was error(s) since the start of the step 1.84 -# failed - the last executed command has exiting anormally 1.85 +# warning - there was an error(s) since the start of the step 1.86 +# failed - the last executed command has exited abnormally 1.87 report_step_status() 1.88 { 1.89 unset report_return_code 1.90 if [ -p $log_tmp.stdout ]; then 1.91 report_stop_listen 1.92 1.93 - #Close message bloc if opened. 1.94 + # Close message bloc if opened. 1.95 if [ -s $log_tmp -a "$report_verbosity_opt" = all ] || \ 1.96 [ -s $log_tmp.error -a "$report_verbosity_opt" != none ]; then 1.97 echo " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " >&3 1.98 @@ -397,10 +397,10 @@ 1.99 ! [ "$prebloc" ] && echo "</div>" >> "$log_opt" 1.100 } 1.101 1.102 -# Theses variables keep the status of the blocs. 1.103 -# A bloc is reported as ok if all child steps are ok and as failed 1.104 +# These variables keep the status of the blocs. 1.105 +# A bloc is reported as ok if all child steps are ok and has failed 1.106 # if all child steps are failed (or if a fatal error occurs). 1.107 -# In other cases the bloc is reported as warning. 1.108 +# In other cases the bloc is reported as a warning. 1.109 report_set_bloc_status() 1.110 { 1.111 bloc_status=$(eval echo \$bloc${bloc_level}_status)