Commit b427f103e12f3e8f120ff02a443be418e6f70a49

Authored by Jean-François Rey
1 parent 561670accd
Exists in master

update log info printed

Showing 7 changed files with 156 additions and 87 deletions Side-by-side Diff

main_tools/ExploitConfidencePass.sh
... ... @@ -125,8 +125,8 @@
125 125 SOLR_RES="$OUTPUT_DIR/solr/"
126 126 EXT_LEX="$OUTPUT_DIR/LEX/"
127 127 TRIGGER_CONFZONE="$OUTPUT_DIR/trigg/"
128   -LOGFILE="$(dirname $OUTPUT_DIR)/info_exploitconf.log"
129   -ERRORFILE="$(dirname $OUTPUT_DIR)/error_exploitconf.log"
  128 +LOGFILE="$OUTPUT_DIR/info_exploitconf.log"
  129 +ERRORFILE="$OUTPUT_DIR/error_exploitconf.log"
130 130  
131 131 CONFPASS_CONFIG_FILE="$(readlink -e $1)/ConfPass.cfg"
132 132 if [ -e $CONFPASS_CONFIG_FILE ]
... ... @@ -175,6 +175,12 @@
175 175 #---------------#
176 176 # Check Pass #
177 177 #---------------#
  178 +if [ $( ${RES_CONf_DIR}/*.res 2> /dev/null | wc -l) -eq 0 ]
  179 +then
  180 + print_error "[${BASENAME}] No Conf Pass res -> exit ExploitConfPass"
  181 + if [ $CHECK -eq 1 ]; then print_log_file $ERRORFILE "No ConfPass res in $[RES_CONf_DIR}" ;fi
  182 + exit 1
  183 +fi
178 184  
179 185 #-----------------------#
180 186 # Segmentation by show #
181 187  
182 188  
183 189  
... ... @@ -188,22 +194,22 @@
188 194 print_info "[${BASENAME}] Segmentation by show" 1
189 195  
190 196 # -> to txt
191   -print_info "[${BASENAME}] Create txt from scored res" 2
  197 +print_info "[${BASENAME}] Create txt from scored res" 3
192 198 cat ${RES_CONF_DIR}/*.res > $INPUT_DIR/$BASENAME.sctm
193 199 cat $INPUT_DIR/$BASENAME.seg | $SIGMUND_BIN/myConvert.pl $INPUT_DIR/$BASENAME.sctm $INPUT_DIR/$BASENAME.tmp
194 200 cat $INPUT_DIR/$BASENAME.tmp | $SCRIPT_PATH/BdlexUC.pl $RULES/basic -f | sed -e "s/_/ /g" | sort -nt 'n' -k '2' > $INPUT_DIR/$BASENAME.txt
195 201  
196 202 # -> to tagger + lemme
197   -print_info "[${BASENAME}] Tag pos and lem in txt file" 2
  203 +print_info "[${BASENAME}] Tag pos and lem in txt file" 3
198 204 iconv -t ISO_8859-1 $INPUT_DIR/$BASENAME.txt > $INPUT_DIR/$BASENAME.tmp
199 205 $SIGMUND_BIN/txt2lem.sh $INPUT_DIR/$BASENAME.tmp $INPUT_DIR/$BASENAME.taglem
200 206  
201 207 # merge sctm and taglem
202   -print_info "[${BASENAME}] Merge scored ctm with tag pos and lem file" 2
  208 +print_info "[${BASENAME}] Merge scored ctm with tag pos and lem file" 3
203 209 cat $INPUT_DIR/$BASENAME.sctm | $SCRIPT_PATH/BdlexUC.pl ${RULES}/basic -f | iconv -t ISO_8859-1 | $SCRIPT_PATH/scoredCtmAndTaggedLem2All.pl $INPUT_DIR/$BASENAME.taglem > $INPUT_DIR/$BASENAME.ctl
204 210  
205 211 # -> new seg
206   -print_info "[${BASENAME}] Create xml file and run Topic Seg" 2
  212 +print_info "[${BASENAME}] Create xml file and run Topic Seg" 3
207 213 $SIGMUND_BIN/tagLem2xml.pl $INPUT_DIR/$BASENAME.taglem $INPUT_DIR/$BASENAME.doc.xml
208 214 rm $INPUT_DIR/$BASENAME.tmp #$INPUT_DIR/$BASENAME.taglem
209 215  
210 216  
... ... @@ -215,11 +221,16 @@
215 221  
216 222 if [ $CHECK -eq 1 ]
217 223 then
218   - if [ ! -s $INPUT_DIR/$BASENAME.show.seg ];then echo -e "[${BASENAME}] ERROR : no Topic segmentation" >> $ERRORFILE; fi
  224 + if [ ! -s $INPUT_DIR/$BASENAME.show.seg ]
  225 + then
  226 + print_error "[${BASENAME}] No Topic segmentation ! "
  227 + print_error "[${BASENAME}] Check $ERRORFILE "
  228 + print_log_file "$ERRORFILE" "No Topic segmentation in ${BASENAME}.show.seg"
  229 + fi
219 230 fi
220 231  
221 232 # Segment ctm into several show files and create a seg list by show
222   -print_info "[${BASENAME}] Segment ctm into show files and a seg list by show" 2
  233 +print_info "[${BASENAME}] Segment ctm into show files and a seg list by show" 1
223 234 $SCRIPT_PATH/ctm2show.pl $INPUT_DIR/$BASENAME.ctl $INPUT_DIR/$BASENAME.show.seg $SHOW_DIR
224 235  
225 236 #-----------------------------------------------------------#
... ... @@ -230,7 +241,7 @@
230 241 # concat word + add date 2 day before and after the show #
231 242 # query document & multimedia #
232 243 #-----------------------------------------------------------#
233   -print_info "[${BASENAME}] Create SOLR queries and ASK SOLR" 1
  244 +print_info "[${BASENAME}] Create SOLR queries and ask SOLR" 1
234 245 for show in $(ls $SHOW_DIR/*.ctm)
235 246 do
236 247 bn=$(basename $show .ctm)
... ... @@ -244,6 +255,7 @@
244 255 if [ $(wc -w "$SHOW_DIR/$bn.queries" | cut -f1 -d' ') -gt 0 ]; then
245 256 query=$(cat $SHOW_DIR/$bn.queries)"&fq=docDate:[$datePattern]"
246 257 echo $query > $SHOW_DIR/$bn.queries
  258 + prnt_info "python $SCRIPT_PATH/ProcessSOLRQueries.py $SHOW_DIR/$bn.queries $SOLR_RES/$bn.keywords.tmp $SOLR_RES/$bn.txt.tmp" 3
247 259 python $SCRIPT_PATH/ProcessSOLRQueries.py $SHOW_DIR/$bn.queries $SOLR_RES/$bn.keywords.tmp $SOLR_RES/$bn.txt.tmp
248 260 cat $SOLR_RES/$bn.keywords.tmp | sort -u > $SOLR_RES/$bn.keywords
249 261 cat $SOLR_RES/$bn.txt.tmp | sort -u > $SOLR_RES/$bn.txt
... ... @@ -254,7 +266,8 @@
254 266 then
255 267 if [ ! -e $SOLR_RES/$bn.keywords ] || [ ! -e $SOLR_RES/$bn.txt ]
256 268 then
257   - print_warn "$bn.keywords and $bn.txt are empty !\nMaybe SOLR server is down !" 1
  269 + print_warn "$bn.keywords and $bn.txt are empty !\nMaybe SOLR server is down !" 2
  270 + print_log_file "$LOGFILE" "$bn.keywords and $bn.txt are empty !\nMaybe SOLR server is down !"
258 271 fi
259 272 fi
260 273  
... ... @@ -278,7 +291,7 @@
278 291 # Tokenize & produce coverage report
279 292 # Use filter you need
280 293 #
281   - print_info "[${BASENAME}] keywords filtering and produce coverage report" 2
  294 + print_info "[${BASENAME}] keywords filtering and produce coverage report" 3
282 295 # Default filter
283 296 cat $i | $SCRIPT_PATH/CleanFilter.sh | ${SCRIPT_PATH}/ApplyCorrectionRules.pl ${LEXICON}.regex | $SCRIPT_PATH/BdlexUC.pl $RULES/basic -t |\
284 297 $SCRIPT_PATH/CoverageReportMaker.pl --out $SOLR_RES/${basename}_tmp_report $LEXICON.bdlex_tok
285 298  
... ... @@ -290,13 +303,13 @@
290 303 # Extract "real" OOV and phonetize them
291 304 # -> petit filtrage persoo pour eviter d'avoir trop de bruits
292 305 #
293   - print_info "[${BASENAME}] Extract OOV and phonetize them" 2
  306 + print_info "[${BASENAME}] Extract OOV and phonetize them" 3
294 307 ${SCRIPT_PATH}/FindNormRules.pl $SOLR_RES/${basename}_tmp_report/report.oov $LEXICON.bdlex_tok | cut -f3 | grep -v "#" | grep -v "^[A-Z]\+$" | grep -v "^[0-9]" | grep --perl-regex -v "^([a-z']){1,3}$" | $SCRIPT_PATH/BdlexUC.pl $RULES/basic -f | iconv -t ISO_8859-1 -f UTF-8 | ${LIA_LTBOX}/lia_phon/script/lia_lex2phon_variante | grep -v "core dumped" | cut -d"[" -f1 | sort -u | ${SCRIPT_PATH}/PhonFormatter.pl | iconv -f ISO_8859-1 -t UTF-8 | $SCRIPT_PATH/BdlexUC.pl $RULES/basic -t > $SOLR_RES/${basename}.phon_oov
295 308  
296 309 #
297 310 # Search INVOC & OOV in the current lattice
298 311 #
299   - print_info "[${BASENAME}] Search INVOC and OOV in the current lattice" 2
  312 + print_info "[${BASENAME}] Search INVOC and OOV in the current lattice" 3
300 313 cat $SOLR_RES/${basename}_tmp_report/report.invoc | grep -v "\b0" | cut -f1 | grep -v --perl-regex -v "^[a-zA-Z']{1,3}$" | grep -v --perl-regex "^[a-zA-Z0-9]{1,3}$" | grep -v "<s>" | grep -v "</s>" | $SCRIPT_PATH/BdlexUC.pl $RULES/basic -t > $TRIGGER_CONFZONE/$basename.tosearch
301 314 cat $SOLR_RES/${basename}.phon_oov | cut -f1 >> $TRIGGER_CONFZONE/$basename.tosearch
302 315  
... ... @@ -326,7 +339,7 @@
326 339 #
327 340 # Collect the acousticly found oov and their phonetisation
328 341 #
329   -print_info "[${BASENAME}] Get all OOV and retrieve all phonetisation" 2
  342 +print_info "[${BASENAME}] Get all OOV and retrieve all phonetisation" 3
330 343 for i in `ls $SOLR_RES/*.phon_oov`
331 344 do
332 345 basename=`basename $i .phon_oov`
... ... @@ -354,7 +367,7 @@
354 367 #
355 368 # Merge OOVs and their phonetisation
356 369 #
357   -print_info "[${BASENAME}] Merge OOV and their phonetisation" 2
  370 +print_info "[${BASENAME}] Merge OOV and their phonetisation" 3
358 371 lexname=$(basename $LEXICON)
359 372 cat $EXT_LEX/*.oov_acousticlyfound_phon | sort -u > $EXT_LEX/final/all.oov_acousticlyfound_phon
360 373 cat $EXT_LEX/*.oov_acousticlyfound | sort -u | grep --perl-regex -v "^([a-z']){3}$" > $EXT_LEX/final/all.oov_acousticlyfound
... ... @@ -377,7 +390,7 @@
377 390 # - Expected format :
378 391 # <WORD1_STRING> <CANDIDATE1_STRING> <PHON_1>
379 392 #
380   -print_info "[${BASENAME}] Construct map file" 2
  393 +print_info "[${BASENAME}] Construct map file" 3
381 394 rm -f $EXT_LEX/final/${lexname}_ext.map 2>/dev/null
382 395 rm -f $EXT_LEX/final/${lexname}.unvalid_oov 2>/dev/null
383 396  
384 397  
385 398  
386 399  
... ... @@ -391,19 +404,21 @@
391 404 #
392 405 # Try to collect text containing the oov word
393 406 #
  407 + print_info "[${BASENAME}] Collect text containing the oov" 3
394 408 cat $EXT_LEX/final/all.bdlex_txt | grep --perl-regex " $oov " | $SCRIPT_PATH/NbMaxWordsFilter.pl 40 |uniq > $EXT_LEX/tmp/txt/$oov.bdlex_txt
395 409 if [ -f $EXT_LEX/tmp/txt/$oov.bdlex_txt ]; then
396 410 nbWords=`wc -l $EXT_LEX/tmp/txt/$oov.bdlex_txt | cut -f1 -d" "`
397 411 if [ $nbWords -eq 0 ]; then
398   - echo "[${BASENAME}] UNVALID OOV: $oov => $nbWords occurrences"
  412 + print_warn "[${BASENAME}] UNVALID OOV: $oov => $nbWords occurrences" 2
399 413 echo "$oov" >> $EXT_LEX/final/${lexname}.unvalid_oov
400 414 else
401 415 #
402 416 # Find a candidate in a filtred invoc lexicon => a candidate which maximize the ppl in the overall txt collected
403 417 #
404 418 #echo "$/getCandidate $SPEER_LM_PATH $SPEER_LM_BASENAME $oov $LEXICON.bdlex_tok $EXT_LEX/tmp/txt/$oov.bdlex_txt"
  419 + print_info `$SPEERAL_PATH/bin/getCandidate $SPEER_LM_PATH $SPEER_LM_BASENAME $oov $CANDIDATE_LEXICON $EXT_LEX/tmp/txt/$oov.bdlex_txt | cut -f1 -d" "` 3
405 420 candidate=`$SPEERAL_PATH/bin/getCandidate $SPEER_LM_PATH $SPEER_LM_BASENAME $oov $CANDIDATE_LEXICON $EXT_LEX/tmp/txt/$oov.bdlex_txt | cut -f1 -d" "`
406   - if [ ! x$candidate = "x" ]; then
  421 + if [ ! "$candidate" == "" ]; then
407 422 grep --perl-regex "^$oov\t" $EXT_LEX/final/all.oov_acousticlyfound_phon > $EXT_LEX/tmp/$oov.phon
408 423 while read phonLine
409 424 do
410 425  
... ... @@ -411,12 +426,12 @@
411 426 echo "$phonLine" | sed "s|\t|\t$candidate\t|" >> $EXT_LEX/final/${lexname}_ext.map
412 427 done < $EXT_LEX/tmp/$oov.phon
413 428 else
414   - echo "[${BASENAME}] UNVALID OOV: $oov => no availaible Candidate word in LM"
  429 + print_warn "[${BASENAME}] UNVALID OOV: $oov => no availaible Candidate word in LM" 2
415 430 echo "$oov" >> $EXT_LEX/final/${lexname}.unvalid_oov
416 431 fi
417 432 fi
418 433 else
419   - echo "[${BASENAME}] UNVALID OOV: $oov"
  434 + print_warn "[${BASENAME}] UNVALID OOV: $oov" 2
420 435 echo "$oov" >> $EXT_LEX/final/${lexname}.unvalid_oov
421 436 fi
422 437 done < $EXT_LEX/final/all.oov_acousticlyfound
... ... @@ -429,7 +444,7 @@
429 444 #
430 445 # Build the final trigger file
431 446 #
432   -print_info "[${BASENAME}] Clean trigg files" 2
  447 +print_info "[${BASENAME}] Clean trigg files" 3
433 448 mkdir -p $TRIGGER_CONFZONE/speeral/ 2> /dev/null
434 449 mkdir -p $EXT_LEX/speeral/ 2> /dev/null
435 450 for i in `ls $TRIGGER_CONFZONE/*.trigg`
... ... @@ -440,7 +455,8 @@
440 455 #
441 456 # Compile the speeral extended lexicon
442 457 #
443   -print_info "[${BASENAME}] Compile Speeral extended lexicon" 2
  458 +print_info "[${BASENAME}] Compile Speeral extended lexicon" 3
  459 +print_info "$SPEERAL_PATH/bin/buildmappedbinode $LEXICON.bdlex_phon $EXT_LEX/final/${lexname}_ext.map $AM_SKL $EXT_LEX/speeral/${lexname}_ext" 3
444 460 $SPEERAL_PATH/bin/buildmappedbinode $LEXICON.bdlex_phon $EXT_LEX/final/${lexname}_ext.map $AM_SKL $EXT_LEX/speeral/${lexname}_ext
445 461  
446 462 if [ $CHECK -eq 1 ]
... ... @@ -448,7 +464,10 @@
448 464 check_exploitconfpass_lex_check "${EXT_LEX}/speeral/${lexname}_ext"
449 465 if [ $? -eq 1 ]
450 466 then
451   - echo -e "[${BASENAME}] ERROR : Building Speeral Lexicon $INPUT_DIR " >> $ERRORFILE
  467 + print_error "[${BASENAME}] Building Speeral Lexicon $INPUT_DIR -> exit"
  468 + print_error "[${BASENAME}] Check $ERRORFILE"
  469 + print_log_file $ERRORFILE "ERROR : Building Speeral Lexicon $INPUT_DIR"
  470 + print_log_file $ERRORFILE "ERROR : ${EXT_LEX}/speeral/${lexname}_ext Empty after buildmappedbinode ?"
452 471 exit 1;
453 472 fi
454 473 fi
455 474  
... ... @@ -458,9 +477,8 @@
458 477 # CLOSE #
459 478 #-------#
460 479 # Seem OK
461   -print_info "[${BASENAME}] <= End $BASENAME Solr | $(date +'%d/%m/%y %H:%M:%S')" 1
462   -echo -e "[${BASENAME}] #Solr $BASENAME " >> $LOGFILE
  480 +print_info "[${BASENAME}] <= ExploitConfidencePass End | $(date +'%d/%m/%y %H:%M:%S')" 1
463 481  
464   -# unlock directory
  482 +# unlok directory
465 483 mv "$OUTPUT_DIR/EXPLOITCONFPASS.lock" "$OUTPUT_DIR/EXPLOITCONFPASS.unlock"
main_tools/FirstPass.sh
... ... @@ -115,7 +115,7 @@
115 115 print_info "[${BASENAME}] => P1 start | $(date +'%d/%m/%y %H:%M:%S')" 1
116 116 print_info "[${BASENAME}] $WAV_FILE OK" 2
117 117 else
118   - print_error "can't find $1 OR file is empty"
  118 + print_error " Can't find $1 OR file is empty"
119 119 exit 1
120 120 fi
121 121  
... ... @@ -247,7 +247,7 @@
247 247 if [ $CHECK -eq 1 ] && ( [ ! -e $SEG_FILE ] || [ -z $SEG_FILE ] )
248 248 then
249 249 print_log_file "$ERRORFILE" "ERROR [$(date +'%d/%m/%y %H:%M:%S')] Creating SEG file : $SEG_FILE"
250   - print_error "[${BASENAME}] ERROR : check $ERRORFILE file"
  250 + print_error "[${BASENAME}] Check $ERRORFILE file"
251 251 exit 1
252 252 fi
253 253  
... ... @@ -260,7 +260,7 @@
260 260 if [ $CHECK -eq 1 ] && ( [ ! -e $LBL_FILE ] || [ -z $LBL_FILE ] )
261 261 then
262 262 print_log_file "$ERRORFILE" "ERROR [$(date +'%d/%m/%y %H:%M:%S')] Creating LBL file : $LBL_FILE"
263   - print_error "[${BASENAME}] ERROR : check $ERRORFILE file"
  263 + print_error "[${BASENAME}] Check $ERRORFILE file"
264 264 exit 1
265 265 fi
266 266  
... ... @@ -279,7 +279,7 @@
279 279 if [ $? -eq 1 ]
280 280 then
281 281 print_log_file $ERRORFILE "ERROR [$(date +'%d/%m/%y %H:%M:%S')] $PLP wrong number of .plp files"
282   - print_error "[${BASENAME}] ERROR : check $ERRORFILE file"
  282 + print_error "[${BASENAME}] Check $ERRORFILE file"
283 283 exit 1
284 284 fi
285 285 fi
... ... @@ -368,7 +368,7 @@
368 368  
369 369 if [ $notdone -ne 0 ]
370 370 then
371   - print_error "[${BASENAME}] ERROR : check $ERRORFILE"
  371 + print_error "[${BASENAME}] Check $ERRORFILE"
372 372 print_log_file "$ERRORFILE" "ERROR : Segs not done ["
373 373 diff ${OUTPUT_DIR_BASENAME}/plp.lst ${OUTPUT_DIR_BASENAME}/.tmp | grep -e "^< " | sed -e "s/< //" >> $ERRORFILE
374 374 print_log_file "$ERRORFILE" "] $pourcentage% $BASENAME"
main_tools/RecomposePass.sh
... ... @@ -59,7 +59,7 @@
59 59 VERBOSE=$OPTARG
60 60 ;;
61 61 :)
62   - echo "Option -$OPTARG requires an argument." >&2
  62 + echo "Option -$OPTARG requires an argument." > /dev/null
63 63 exit 1
64 64 ;;
65 65 \?)
66 66  
... ... @@ -100,12 +100,18 @@
100 100 #-------------#
101 101 # GLOBAL VARS #
102 102 #-------------#
  103 +BASENAME=$(basename $PASS_DIR)
  104 +OUTPUT_DIR_BASENAME=$PASS_DIR
  105 +RES_DIR="$PASS_DIR/res_all"
  106 +LOGFILE=$PASS_DIR"/info_recpass.log"
  107 +ERRORFILE=$PASS_DIR"/error_recpass.log"
  108 +
103 109 THIRDPASS_CONFIG_FILE="$PASS_DIR/ThirdPass.cfg"
104 110 if [ -e $THIRDPASS_CONFIG_FILE ]
105 111 then
106 112 RES_P3=$(cat $THIRDPASS_CONFIG_FILE | grep "^RES_DIR=" | cut -f2 -d"=")
107 113 else
108   - print_warn "can't find $THIRDPASS_CONFIG_FILE file" 1
  114 + print_warn "[${BASENAME}] can't find $THIRDPASS_CONFIG_FILE file" 2
109 115 #exit 1
110 116 fi
111 117 SECONDPASS_CONFIG_FILE="$PASS_DIR/SecondPass.cfg"
... ... @@ -113,7 +119,7 @@
113 119 then
114 120 RES_P2=$(cat $SECONDPASS_CONFIG_FILE | grep "^RES_DIR=" | cut -f2 -d"=")
115 121 else
116   - print_warn "can't find $SECONDPASS_CONFIG_FILE file" 1
  122 + print_warn "[${BASENAME}] can't find $SECONDPASS_CONFIG_FILE file" 2
117 123 #exit 1
118 124 fi
119 125 FIRSTPASS_CONFIG_FILE="$PASS_DIR/FirstPass.cfg"
120 126  
121 127  
122 128  
123 129  
124 130  
... ... @@ -121,34 +127,36 @@
121 127 then
122 128 RES_P1=$(cat $FIRSTPASS_CONFIG_FILE | grep "^RES_DIR=" | cut -f2 -d"=")
123 129 else
124   - print_warn "can't find $FIRSTPASS_CONFIG_FILE file"
  130 + print_warn "[${BASENAME}] can't find $FIRSTPASS_CONFIG_FILE file" 2
125 131 #exit 1
126 132 fi
127 133  
128   -if ( [ -z "$RES_P1" ] && [ -z "$RES_P2" ] ) || [ -z $RES_P3 ]; then echo "ERROR no configuration pass files in $PASS_DIR"; exit 1; fi
  134 +if ( [ -z "$RES_P1" ] && [ -z "$RES_P2" ] ) || [ -z $RES_P3 ]
  135 +then
  136 + print_error "[${BASENAME}] No configuration pass files in $PASS_DIR -> exit"
  137 + if [ $CHECK -eq 1 ]; then print_log_file $ERROFILE "No configuration pass files in $PASS_DIR -> exit";fi
  138 + exit 1
  139 +fi
129 140  
130   -BASENAME=$(basename $PASS_DIR)
131   -OUTPUT_DIR_BASENAME=$PASS_DIR
132   -RES_DIR="$PASS_DIR/res_all"
133   -LOGFILE=$(dirname $PASS_DIR)"/info_recpass.log"
134   -ERRORFILE=$(dirname $PASS_DIR)"/error_recpass.log"
  141 +print_info "[${BASENAME}] => RecomposePass start | $(date +'%d/%m/%y %H:%M:%S')" 1
135 142  
136 143 #------------------#
137 144 # Create WORKSPACE #
138 145 #------------------#
139 146  
140 147 # Lock directory
141   -if [ -e $OUTPUT_DIR_BASENAME/RECOMPOSEPASS.lock ] && [ $RERUN -eq 0 ]; then exit 1;fi
  148 +if [ -e $OUTPUT_DIR_BASENAME/RECOMPOSEPASS.lock ] && [ $RERUN -eq 0 ]
  149 +then
  150 + print_warn "[${BASENAME}] RECOMPOSEPASS is locked -> exit" 2
  151 + exit 1
  152 +fi
142 153 rm "$OUTPUT_DIR_BASENAME/RECOMPOSEPASS.unlock" > /dev/null 2>&1
143 154 touch "$OUTPUT_DIR_BASENAME/RECOMPOSEPASS.lock" > /dev/null 2>&1
144 155  
145 156 if [ $RERUN -eq 0 ]; then rm -r $RES_DIR > /dev/null 2>&1; fi
146   -mkdir -p $RES_DIR
147   -print_info "Make directory $RES_DIR" 1
  157 +mkdir -p $RES_DIR 2> /dev/null
  158 +print_info "Make directory $RES_DIR" 3
148 159  
149   -rm $RES_DIR 2> /dev/null
150   -mkdir -p $RES_DIR
151   -
152 160 #--------------------#
153 161 # Save configuration #
154 162 #--------------------#
155 163  
... ... @@ -157,12 +165,12 @@
157 165 echo "RES_P1=$RES_P1" >> $OUTPUT_DIR_BASENAME/RecomposePass.cfg
158 166 echo "RES_P2=$RES_P2" >> $OUTPUT_DIR_BASENAME/RecomposePass.cfg
159 167 echo "RES_P3=$RES_P3" >> $OUTPUT_DIR_BASENAME/RecomposePass.cfg
160   -print_info "save config in $OUTPUT_DIR_BASENAME/RecomposePass.cfg" 1
  168 +print_info "[${BASENAME}] Save config in $OUTPUT_DIR_BASENAME/RecomposePass.cfg" 1
161 169  
162 170 #--------------------------------------------------#
163 171 # Recompose Pass using previous pass #
164 172 #--------------------------------------------------#
165   -print_info "Launch Recompose Pass" 1
  173 +print_info "[${BASENAME}] Launch Recompose Pass" 1
166 174  
167 175 ## Check seg in p3
168 176 cp $RES_P3/*.res $RES_DIR
169 177  
170 178  
171 179  
172 180  
... ... @@ -181,23 +189,26 @@
181 189 cp $RES_P1/$res.res $RES_DIR
182 190 done
183 191  
184   -rm ${OUTPUT_DIR_BASENAME}/res_p3.tmp ${OUTPUT_DIR_BASENAME}/res_p2.tmp ${OUTPUT_DIR_BASENAME}/res_p1.tmp ${OUTPUT_DIR_BASENAME}/res_all.tmp
  192 +rm ${OUTPUT_DIR_BASENAME}/res_p3.tmp ${OUTPUT_DIR_BASENAME}/res_p2.tmp ${OUTPUT_DIR_BASENAME}/res_p1.tmp ${OUTPUT_DIR_BASENAME}/res_all.tmp 2> /dev/null
185 193  
186 194 #---------------#
187 195 # Convert res #
188 196 #---------------#
189 197  
  198 +print_info "[${BASENAME}] Convert .res into .ctm" 1
190 199 # .res => .ctm
191 200 $SCRIPT_PATH/res2out.pl --dir $RES_DIR --format CTM --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.allpass.ctm
  201 +print_info "[${BASENAME}] Convert .res into .trs" 1
192 202 # .res => .trs
193 203 echo -e "name $AUTHOR\nfileName ${BASENAME}\nfileExt wav\nsegFile ${OUTPUT_DIR_BASENAME}/${BASENAME}.seg" > ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg
194 204 $SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TRS --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.allpass.trs --trs_config ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg
195 205 rm ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg
  206 +print_info "[${BASENAME}] Convert .res into .txt" 1
196 207 # .res => .txt
197 208 $SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TXT --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.allpass.txt
198 209  
199 210  
200   -print_info "<= End $BASENAME RecomposePass | $(date +'%d/%m/%y %H:%M:%S')" 1
  211 +print_info "[${BASENAME}] <= RecomposePass End | $(date +'%d/%m/%y %H:%M:%S')" 1
201 212  
202 213 # unlock directory
203 214 mv "$OUTPUT_DIR_BASENAME/RECOMPOSEPASS.lock" "$OUTPUT_DIR_BASENAME/RECOMPOSEPASS.unlock"
main_tools/ScoringRes.sh
... ... @@ -101,15 +101,21 @@
101 101 #-------------#
102 102 BASENAME=$(basename $PASS_DIR)
103 103 SCORING_DIR=$PASS_DIR/scoring
104   -LOGFILE="$(dirname $PASS_DIR)/info_scoring.log"
105   -ERRORFILE="$(dirname $PASS_DIR)/error_scoring.log"
  104 +LOGFILE="$PASS_DIR/info_scoring.log"
  105 +ERRORFILE="$PASS_DIR/error_scoring.log"
106 106  
  107 +print_info "[${BASENAME}] => ScoringRes start | $(date +'%d/%m/%y %H:%M:%S')" 1
  108 +
107 109 #------------------#
108 110 # Create WORKSPACE #
109 111 #------------------#
110 112  
111 113 # Lock directory
112   -if [ -e $PASS_DIR/*.lock ]; then echo "$PASS_DIR is lock"; exit 1;fi
  114 +if [ -e $PASS_DIR/*.lock ]
  115 +then
  116 + print_warn "[${BASENAME}] Directory is locked -> exit" 2;
  117 + exit 1
  118 +fi
113 119  
114 120 rm -r $SCORING_DIR > /dev/null 2>&1
115 121 mkdir -p $SCORING_DIR
116 122  
117 123  
118 124  
... ... @@ -117,18 +123,20 @@
117 123  
118 124 if [ ! -e $PASS_DIR/$BASENAME.SRT ]
119 125 then
120   - echo -e "no SRT file for $BASENAME\n"
  126 + print_warn "[${BASENAME}] No SRT file -> exit" 2
121 127 exit 0;
122 128 else
123 129 SRT_FILE=$PASS_DIR/$BASENAME.SRT
  130 + print_info "[${BASENAME}] SRT file : $BASENAME.SRT" 1
124 131 fi
125 132  
126 133 if [ ! -e $PASS_DIR/$BASENAME.1pass.ctm ] && [ ! -e $PASS_DIR/$BASENAME.2pass.ctm ] && [ ! -e $PASS_DIR/$BASENAME.3pass.ctm ] && [ ! -e $PASS_DIR/$BASENAME.allpass.ctm ]
127 134 then
128   - echo -e "no CTM files for $BASENAME\n";
  135 + print_error "[${BASENAME}] No CTM files -> exit\n";
129 136 exit 1;
130 137 fi
131 138  
  139 +print_info "[${BASENAME}] Create stm file from SRT" 1
132 140 i=$((-3))
133 141 while read line
134 142 do
135 143  
136 144  
... ... @@ -146,9 +154,13 @@
146 154 $SCRIPT_PATH/srt2stm.pl $SCORING_DIR/$BASENAME.tmp2.txt > "$SCORING_DIR/$BASENAME.stm"
147 155 rm $SCORING_DIR/$BASENAME.tmp.txt $SCORING_DIR/$BASENAME.tmp2.txt
148 156  
  157 +print_info "Scoring using sclite" 1
149 158 for ctmfile in $(ls $PASS_DIR/*.ctm)
150 159 do
151 160 cp $ctmfile $SCORING_DIR/
  161 + print_info "$BIN_PATH/sclite -D -F -r $SCORING_DIR/$BASENAME.stm stm -h $SCORING_DIR/$(basename $ctmfile) ctm -o all" 3
152 162 $BIN_PATH/sclite -D -F -r $SCORING_DIR/$BASENAME.stm stm -h $SCORING_DIR/$(basename $ctmfile) ctm -o all
153 163 done
  164 +
  165 +print_info "[${BASENAME}] <= ScoringRes End | $(date +'%d/%m/%y %H:%M:%S')" 1
main_tools/SecondPass.sh
... ... @@ -107,12 +107,10 @@
107 107 then
108 108 FIRSTPASS_DIR=$(readlink -e $1)
109 109 else
110   - print_error "can't find $1 directory"
  110 + print_error "Can't find $1 directory"
111 111 exit 1
112 112 fi
113 113  
114   -print_info "[${BASENAME}] => P2 start | $(date +'%d/%m/%y %H:%M:%S')" 1
115   -
116 114 #-------------#
117 115 # GLOBAL VARS #
118 116 #-------------#
... ... @@ -129,7 +127,7 @@
129 127 LBL_FILE_P1=$(cat $FIRSTPASS_CONFIG_FILE | grep "LBL_FILE=" | cut -f2 -d"=")
130 128 RES_DIR_P1=$(cat $FIRSTPASS_CONFIG_FILE | grep "RES_DIR=" | cut -f2 -d"=")
131 129 else
132   - print_error "can't find $FIRSTPASS_CONFIG_FILE file"
  130 + print_error "Can't find $FIRSTPASS_CONFIG_FILE file"
133 131 print_error "exit"
134 132 exit 1
135 133 fi
... ... @@ -139,6 +137,8 @@
139 137 LOGFILE="$OUTPUT_DIR_BASENAME/info_p2.log"
140 138 ERRORFILE="$OUTPUT_DIR_BASENAME/error_p2.log"
141 139  
  140 +print_info "[${BASENAME}] => P2 start | $(date +'%d/%m/%y %H:%M:%S')" 1
  141 +
142 142 #------------------#
143 143 # Create WORKSPACE #
144 144 #------------------#
145 145  
... ... @@ -304,12 +304,12 @@
304 304 pourcentage=$((($notdone*100)/$todo))
305 305 if [ $notdone -ne 0 ]
306 306 then
307   - print_error "[${BASENAME}] ERROR : check $ERRORFILE"
  307 + print_error "[${BASENAME}] Check $ERRORFILE"
308 308 print_log_file "$ERRORFILE" "ERROR : Treil not done ["
309 309 diff ${PLP_FILE_P1} ${OUTPUT_DIR_BASENAME}/.tmp | grep -e "^< " | sed -e "s/< //" >> $ERRORFILE
310 310 print_log_file "$ERRORFILE" "] $pourcentage% $BASENAME"
311 311 else
312   - print_log_file "$LOGFILE" "P1 OK $BASENAME | $(date +'%d/%m/%y %H:%M:%S')"
  312 + print_log_file "$LOGFILE" "P2 OK $BASENAME | $(date +'%d/%m/%y %H:%M:%S')"
313 313 fi
314 314 rm ${OUTPUT_DIR_BASENAME}/.tmp > /dev/null 2>&1
315 315 fi
main_tools/ThirdPass.sh
... ... @@ -70,7 +70,7 @@
70 70 RERUN=1
71 71 ;;
72 72 :)
73   - echo "Option -$OPTARG requires an argument." >&2
  73 + echo "Option -$OPTARG requires an argument." > /dev/null
74 74 exit 1
75 75 ;;
76 76 \?)
77 77  
... ... @@ -103,11 +103,14 @@
103 103 if [ -e $1 ] && [ -d $1 ]
104 104 then
105 105 PASS_DIR=$(readlink -e $1)
  106 + BASENAME=$(basename $PASS_DIR)
106 107 else
107 108 print_error "can't find $1 directory"
108 109 exit 1
109 110 fi
110 111  
  112 +print_info "[${BASENAME}] => P3 start | $(date +'%d/%m/%y %H:%M:%S')" 1
  113 +
111 114 #-------------#
112 115 # GLOBAL VARS #
113 116 #-------------#
114 117  
115 118  
116 119  
117 120  
118 121  
119 122  
120 123  
121 124  
122 125  
123 126  
124 127  
... ... @@ -121,62 +124,67 @@
121 124 PLP_DIR_P1=""
122 125 HMM=""
123 126 else
124   - print_error "can't find $EXPLOITCONFPASS_CONFIG_FILE file"
  127 + print_error "[${BASENAME}] Can't find $EXPLOITCONFPASS_CONFIG_FILE file"
  128 + print_warn "[${BASENAME}] Will use default directories and files" 2
125 129 #exit 1
126 130 TRIGGER_SPEERAL=$PASS_DIR/trigg/speeral/
127 131 LEX_SPEERAL=$PASS_DIR/LEX/speeral/LEXIQUE_V6_ext
128 132 LEX_BINODE_SPEERAL=$PASS_DIR/LEX/speeral/LEXIQUE_V6_ext.bin
129 133 fi
  134 +
130 135 SECONDPASS_CONFIG_FILE="$PASS_DIR/SecondPass.cfg"
131 136 if [ -e $SECONDPASS_CONFIG_FILE ]
132 137 then
133 138 LST=$(cat $SECONDPASS_CONFIG_FILE | grep "^LST=" | cut -f2 -d"=")
134 139 HMM=$(cat $SECONDPASS_CONFIG_FILE | grep "^HMM=" | cut -f2 -d"=")
135 140 PLP_DIR_P1=$(cat $SECONDPASS_CONFIG_FILE | grep "^PLP_DIR_P1=" | cut -f2 -d"=")
  141 + PLP_FILE_P1=$(cat $SECONDPASS_CONFIG_FILE | grep "^PLP_FILE_P1=" | cut -f2 -d"=")
136 142 else
137   - print_error "can't find $SECONDPASS_CONFIG_FILE file"
  143 + print_error "[${BASENAME}] Can't find $SECONDPASS_CONFIG_FILE file"
  144 + print_warn "[${BASENAME}] Will use default directories and files" 2
138 145 #exit 1
139 146 LST=$PASS_DIR/lists
140 147 HMM=$PASS_DIR/hmm
141 148 PLP_DIR_P1=$PASS_DIR/PLP
  149 + PLP_FILE_P1=$PASS_DIR/plp.lst
142 150 fi
143 151  
144   -BASENAME=$(basename $PASS_DIR)
145 152 OUTPUT_DIR_BASENAME=$PASS_DIR
146 153 RES_DIR="$PASS_DIR/res_p3"
147   -LOGFILE=$(dirname $PASS_DIR)"/info_p3.log"
148   -ERRORFILE=$(dirname $PASS_DIR)"/error_p3.log"
  154 +LOGFILE=$PASS_DIR"/info_p3.log"
  155 +ERRORFILE=$PASS_DIR"/error_p3.log"
149 156  
150 157 #------------------#
151 158 # Create WORKSPACE #
152 159 #------------------#
153 160  
154 161 # Lock directory
155   -if [ -e $OUTPUT_DIR_BASENAME/THIRDPASS.lock ] && [ $RERUN -eq 0 ]; then exit 1;fi
  162 +if [ -e $OUTPUT_DIR_BASENAME/THIRDPASS.lock ] && [ $RERUN -eq 0 ]; then print_warn "[${BASENAME}] THIRDPASS is locked -> exit" 2; exit 1; fi
156 163 rm "$OUTPUT_DIR_BASENAME/THIRDPASS.unlock" > /dev/null 2>&1
157 164 touch "$OUTPUT_DIR_BASENAME/THIRDPASS.lock" > /dev/null 2>&1
158 165  
159 166 if [ $RERUN -eq 0 ]; then rm -r $RES_DIR > /dev/null 2>&1; fi
160 167 mkdir -p $RES_DIR
161   -print_info "Make directory $RES_DIR" 1
  168 +print_info "[${BASENAME}] Make directory $RES_DIR" 3
162 169  
163 170 #--------------------#
164 171 # Save configuration #
165 172 #--------------------#
166 173 cp $THIRDPASS_CONFIG_FILE $OUTPUT_DIR_BASENAME/ThirdPass.cfg
167 174 echo "RES_DIR=$RES_DIR" >> $OUTPUT_DIR_BASENAME/ThirdPass.cfg
168   -print_info "save config in $OUTPUT_DIR_BASENAME/SecondPass.cfg" 1
  175 +print_info "[${BASENAME}] Save config in $OUTPUT_DIR_BASENAME/ThirdPass.cfg" 1
169 176  
170 177 #--------------------------------------------------#
171 178 # Third Pass using trigger file (DECODING) #
172 179 #--------------------------------------------------#
173   -print_info "Launch Third Pass" 1
  180 +print_info "[${BASENAME}] Launch Third Pass" 1
174 181  
175 182 ## Generate speeral config file adding trigger rep
176 183 cat $SPEERAL_CFG_PATH/$SPEERAL_CFG_FILE | sed -e "s|<nom>[^<]*</nom>|<nom>$OUTPUT_DIR_BASENAME/LEX/speeral/LEXIQUE_V6_ext</nom>|g" \
177 184 | sed -e "s|<binode>[^<]*</binode>|<binode>$OUTPUT_DIR_BASENAME/LEX/speeral/LEXIQUE_V6_ext.bin</binode>|g" \
178 185 | sed -e "s|<trigger><dir>[^<]*</dir></trigger>|<trigger><dir>$TRIGGER_SPEERAL</dir></trigger>|g" > $OUTPUT_DIR_BASENAME/SpeeralThirdPass.xml
179 186 SPEERAL_THIRD_CFG=$OUTPUT_DIR_BASENAME/SpeeralThirdPass.xml
  187 +print_info "[${BASENAME}] Third Pass Speeral Config file ${SPEERAL_THIRD_CFG}" 3
180 188  
181 189 # for all speaker
182 190 for lspeaker in $(ls $LST/*.lst)
183 191  
... ... @@ -193,10 +201,11 @@
193 201 ## Speeral decoding
194 202 if [ -s $HMM/$speaker.hmm ] && [ -s $HMM/$speaker.cls ]
195 203 then
196   - print_info "$SPEERAL_BIN $LST/$speaker.lst $RES_DIR $SPEERAL_THIRD_CFG -r $PLP_DIR_P1 -m $HMM/$speaker.hmm -c $HMM/$speaker.cls $FORKS --lock" 3
  204 + print_info "[${BASENAME}] $SPEERAL_BIN $LST/$speaker.lst $RES_DIR $SPEERAL_THIRD_CFG -r $PLP_DIR_P1 -m $HMM/$speaker.hmm -c $HMM/$speaker.cls $FORKS --lock" 3
197 205 $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_THIRD_CFG} -r $PLP_DIR_P1 -m $HMM/$speaker.hmm -c $HMM/$speaker.cls $FORKS --lock
198 206 else
199   - print_warn "$HMM/$speaker.hmm and $speaker.cls empty, do default decoding..." 2
  207 + print_warn "[${BASENAME}] $HMM/$speaker.hmm and $speaker.cls empty, do default decoding..." 2
  208 + print_info "$SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_THIRD_CFG} -r $PLP_DIR_P1 -m $SPEERAL_AM/${MODS[$i]}.hmm -c $SPEERAL_AM/${MODS[$i]}.cls $FORKS --lock" 3
200 209 $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_THIRD_CFG} -r $PLP_DIR_P1 -m $SPEERAL_AM/${MODS[$i]}.hmm -c $SPEERAL_AM/${MODS[$i]}.cls $FORKS --lock
201 210 fi
202 211  
203 212  
204 213  
... ... @@ -205,12 +214,14 @@
205 214 check_third_pass_output_speeral "$LST/$speaker.lst" "$RES_DIR"
206 215 if [ $? -eq 1 ]
207 216 then
208   - echo -e "ERROR : Speeral $LST/$speaker.lst\n[" >> $ERRORFILE
  217 +
  218 + print_warn "[${BASENAME}] Speeral output error : check $LOGFILE" 2
  219 + print_log_file $LOGFILE "WARN : Speeral number of output ERROR $LST/$speaker.lst"
209 220 ls $RES_DIR/*.seg | grep -e "$speaker" | sed -e "s|$RES_DIR\/||" | sed -e 's/\.seg//' | sort > ${OUTPUT_DIR_BASENAME}/.tmp
210   - diff $LST/$speaker.lst ${OUTPUT_DIR_BASENAME}/.tmp >> $ERRORFILE
211   - echo -e "] " >> $ERRORFILE
  221 + print_log_file $LOGFILE "Segs (and treil) not done :\n["
  222 + diff $LST/$speaker.lst ${OUTPUT_DIR_BASENAME}/.tmp >> $LOGFILE
  223 + print_log_file $LOGFILE "] [$(date +'%d/%m/%y %H:%M:%S')]"
212 224 rm ${OUTPUT_DIR_BASENAME}/.tmp
213   - #exit 1
214 225 fi
215 226 fi
216 227 break
217 228  
218 229  
219 230  
220 231  
221 232  
... ... @@ -220,27 +231,45 @@
220 231 done
221 232  
222 233 ## Check missing seg and log it
223   -ls $RES_DIR/*.res | sed -e "s|$RES_DIR\/||g" | sed -e 's/\.res//' | sort > ${OUTPUT_DIR_BASENAME}/.tmp
224   -echo -e "$BASENAME P3 END\n[" >> $LOGFILE
225   -diff ${OUTPUT_DIR_BASENAME}/plp.lst ${OUTPUT_DIR_BASENAME}/.tmp | grep -e "^< " | sed -e "s/< //" >> $LOGFILE
226   -echo -e "] $BASENAME" >> $LOGFILE
227   -rm ${OUTPUT_DIR_BASENAME}/.tmp > /dev/null 2>&1
228 234  
  235 +## Check missing seg and log it
  236 +if [ $CHECK -eq 1 ]
  237 +then
  238 + ls $RES_DIR/*.treil | sed -e "s|$RES_DIR\/||g" | sed -e 's/\.treil//' | sort > ${OUTPUT_DIR_BASENAME}/.tmp
  239 + todo=$(cat ${PLP_FILE_P1} | wc -l)
  240 + if [ $todo -eq 0 ]; then todo=1;fi
  241 + notdone=$(($todo - $(cat ${OUTPUT_DIR_BASENAME}/.tmp | wc -l)))
  242 + pourcentage=$((($notdone*100)/$todo))
  243 + if [ $notdone -ne 0 ]
  244 + then
  245 + print_error "[${BASENAME}] Check $ERRORFILE"
  246 + print_log_file "$ERRORFILE" "ERROR : Treil not done ["
  247 + diff ${PLP_FILE_P1} ${OUTPUT_DIR_BASENAME}/.tmp | grep -e "^< " | sed -e "s/< //" >> $ERRORFILE
  248 + print_log_file "$ERRORFILE" "] $pourcentage% $BASENAME"
  249 + else
  250 + print_log_file "$LOGFILE" "P3 OK $BASENAME | $(date +'%d/%m/%y %H:%M:%S')"
  251 + fi
  252 + rm ${OUTPUT_DIR_BASENAME}/.tmp > /dev/null 2>&1
  253 +fi
  254 +
229 255 #---------------#
230 256 # Convert res #
231 257 #---------------#
232 258  
  259 +print_info "[${BASENAME}] Convert .res into .ctm" 1
233 260 # .res => .ctm
234 261 $SCRIPT_PATH/res2out.pl --dir $RES_DIR --format CTM --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.3pass.ctm
  262 +print_info "[${BASENAME}] Convert .res into .trs" 1
235 263 # .res => .trs
236 264 echo -e "name $AUTHOR\nfileName ${BASENAME}\nfileExt wav\nsegFile ${OUTPUT_DIR_BASENAME}/${BASENAME}.seg" > ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg
237 265 $SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TRS --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.3pass.trs --trs_config ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg
238 266 rm ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg > /dev/null 2>&1
  267 +print_info "[${BASENAME}] Convert .res into .txt" 1
239 268 # .res => .txt
240 269 $SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TXT --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.3pass.txt
241 270  
242 271  
243   -print_info "<= End $BASENAME P3 | $(date +'%d/%m/%y %H:%M:%S')" 1
  272 +print_info "[${BASENAME}] <= P3 End | $(date +'%d/%m/%y %H:%M:%S')" 1
244 273  
245 274 # unlock directory
246 275 mv "$OUTPUT_DIR_BASENAME/THIRDPASS.lock" "$OUTPUT_DIR_BASENAME/THIRDPASS.unlock"
tools/scripts/Tools.sh
... ... @@ -29,13 +29,13 @@
29 29 if [ $# -eq 3 ]
30 30 then
31 31 # print error
32   - if [ $1 -eq $ERROR ]; then echo -ne "###ERROR : $3\n" > /dev/stderr; exit 0; fi
  32 + if [ $1 -eq $ERROR ]; then echo -ne "###ERROR : $3\n" > /dev/stderr; return 0; fi
33 33 # check verbose level
34 34 if [ $2 -le $VERBOSE ]
35 35 then
36 36 #for (( dec=1 ; $dec<$2 ; dec++ )); do echo -ne "\t"; done
37 37 # print warn
38   - if [ $1 = $WARN ]; then echo -ne "##WARNING : $3\n"; exit 0; fi
  38 + if [ $1 = $WARN ]; then echo -ne "##WARNING : $3\n"; return 0; fi
39 39 # default info
40 40 echo -ne "#INFO : $3\n"
41 41 fi
... ... @@ -82,7 +82,7 @@
82 82 {
83 83 if [ $# -eq 2 ]
84 84 then
85   - echo -e "$2" >> $1
  85 + echo -e "$2" >> "$1"
86 86 fi
87 87 }