Blame view

tools/scripts/CheckFirstPass.sh 1.96 KB
e6be5137b   Jean-François Rey   reinitialized pro...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  #!/bin/bash
  
  #################################################
  # File :    CheckFirstPass.sh                   #
  # Brief :   Check First Pass                    #
  # Author :  Jean-François Rey                   #
  # Version : 1.0                                 #
  # Date :    13/06/13                            #
  #################################################
  
  # configuration file
  . "$OTMEDIA_HOME/cfg/FirstPass.cfg"
  
  # check_first_pass_plp(filenamefullpath)
  # - filenamefullpath : full path to plp file
  # return 0 if ok, otherwise return 1
  function check_first_pass_plp()
  {
      if [ $# -eq 1 ]
      then
          if [ ! -e "$1" ] || [ -z "$1" ]; then return 1; fi
          LINESNB=$($BIN_PATH/aff_mat$ARCH "$1" | wc -l)
          if [ $LINESNB -lt 350000 ]
          then
              return 1
          fi
      fi 
      return 0
  }
  
  # check_first_pass_plps_lbl(plppath,lblfile)
  # - plppath : path to plp files
  # - lblfile : a lblfile
  # return 0 if plp files nb == nb files contain in lbl , 1 otherwise
  function check_first_pass_plps_lbl()
  {
      if [ $# -eq 2 ]
      then
          if [ ! -e "$1" ] || [ -z "$1" ]; then return 1; fi
          if [ ! -e "$2" ] || [ -z "$2" ]; then return 1; fi
          FILENBLBL=$(cat "$2" | wc -l)
1c85f8188   Jean-François Rey   update Checktools
42
          FILENBPLP=$(ls "$1" 2>/dev/null | wc -l)
e6be5137b   Jean-François Rey   reinitialized pro...
43
44
45
46
47
48
49
50
51
52
53
54
55
56
          if [ $FILENBLBL -ne $FILENBPLP ]; then return 1; fi
      fi
      return 0
  }
  
  
  #check_first_pass_output_speeral(plplist,resdir)
  # - plplist : filename containing plp list
  # - resdir  : output Speeral directory 
  check_first_pass_output_speeral()
  {
      if [ $# -eq 2 ]
      then
          if [ ! -e "$1" ] || [ -z "$1" ]; then return 1; fi
1c85f8188   Jean-François Rey   update Checktools
57
58
          FILENBSEG=$(ls $2/*.seg 2>/dev/null | grep -f "$1" | wc -l)
          FILENBRES=$(ls $2/*.res 2>/dev/null | grep -f "$1" | wc -l)
e6be5137b   Jean-François Rey   reinitialized pro...
59
60
61
62
63
64
65
          #FILENBPHO=$(ls "$2/*.pho" | grep -f "$1" | wc -l)
          FILENB=$(cat "$1" | wc -l)    
          FILENBPHO=$FILENB
          if [ $FILENB -ne $FILENBSEG ] || [ $FILENB -ne $FILENBRES ] || [ $FILENB -ne $FILENBPHO ] ; then return 1;fi
      fi
      return 0
  }