Subversion Repositories wimsdev

Rev

Rev 16164 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16164 Rev 16233
Line 42... Line 42...
42
    # test if statut of sheet is non 0
42
    # test if statut of sheet is non 0
43
    statut=`awk -v no="$num" 'BEGIN{cpt=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){print($0);exit;}}' .sheets`;
43
    statut=`awk -v no="$num" 'BEGIN{cpt=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){print($0);exit;}}' .sheets`;
44
    if [ "$statut" != ":0" ]; then
44
    if [ "$statut" != ":0" ]; then
45
     entete=`awk '{a=substr($0,1,1); if(a==":")exit; else print($0);}' $sh`;
45
     entete=`awk '{a=substr($0,1,1); if(a==":")exit; else print($0);}' $sh`;
46
     namesh=${sh##.};
46
     namesh=${sh##.};
-
 
47
     if [ -z `grep -r :classes/ $sh` ]; then
47
     if [ -n "$entete" ]; then
48
      if [ -n "$entete" ]; then
48
      #First case : information is in file .sheet$i : keep it (but not title and desc)
49
        #First case : information is in file .sheet$i : keep it (but not title and desc)
49
      # echo "$sh : direct copy";
50
        # echo "$sh : direct copy";
50
      title=`awk -v no="$num" 'BEGIN{cpt=0;l=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){l++;if(l==3){print($0);exit;}} }' .sheets`;
51
        title=`awk -v no="$num" 'BEGIN{cpt=0;l=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){l++;if(l==3){print($0);exit;}} }' .sheets`;
51
      desc=`awk -v no="$num" 'BEGIN{cpt=0;l=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){l++;if(l==4){print($0);exit;}} }' .sheets`;
52
        desc=`awk -v no="$num" 'BEGIN{cpt=0;l=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){l++;if(l==4){print($0);exit;}} }' .sheets`;
52
      echo "$title
53
        echo "$title
53
$desc" >$tmptarget/$namesh.def;
54
$desc" >$tmptarget/$namesh.def;
54
      awk 'FNR>2{print $0}' $sh >>$tmptarget/$namesh.def;
55
        awk 'FNR>2{print $0}' $sh >>$tmptarget/$namesh.def;
55
     else
56
      else
56
      #second case : information not in file .sheet$i : make it with files .sheets and .def.
57
        #second case : information not in file .sheet$i : make it with files .sheets and .def.
57
      dt=`perl -e 'for (@ARGV) {@S=stat($_); print scalar(localtime($S[9]))}' $sh`
58
        dt=`perl -e 'for (@ARGV) {@S=stat($_); print scalar(localtime($S[9]))}' $sh`
58
      dt=${dt##* };
59
        dt=${dt##* };
59
      title=`awk -v no="$num" 'BEGIN{cpt=0;l=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){l++;if(l==3){print($0);exit;}} }' .sheets`;
60
        title=`awk -v no="$num" 'BEGIN{cpt=0;l=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){l++;if(l==3){print($0);exit;}} }' .sheets`;
60
      desc=`awk -v no="$num" 'BEGIN{cpt=0;l=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){l++;if(l==4){print($0);exit;}} }' .sheets`;
61
        desc=`awk -v no="$num" 'BEGIN{cpt=0;l=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){l++;if(l==4){print($0);exit;}} }' .sheets`;
61
      keyword=`awk -v no="$num" 'BEGIN{cpt=0;l=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){l++;if(l==6){print($0);exit;}} }' .sheets`;
62
        keyword=`awk -v no="$num" 'BEGIN{cpt=0;l=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){l++;if(l==6){print($0);exit;}} }' .sheets`;
62
      domain1=`awk -v no="$num" 'BEGIN{cpt=0;l=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){l++;if(l==5){print($0);exit;}} }' .sheets`;
63
        domain1=`awk -v no="$num" 'BEGIN{cpt=0;l=0;} {a=substr($0,1,1); if(a==":")cpt++; if(cpt==no){l++;if(l==5){print($0);exit;}} }' .sheets`;
63
      ## if keyword is empty, take the level (only for H)
64
        ## if keyword is empty, take the level (only for H)
64
      if [ ! -n "$keyword" ]; then
65
        if [ ! -n "$keyword" ]; then
65
       if [ -n "$slevel" ]; then
66
          if [ -n "$slevel" ]; then
66
        keyword=`echo "$slevel"`;
67
           keyword=`echo "$slevel"`;
67
       else
68
          else
68
        keyword=`echo "level$level"`;
69
           keyword=`echo "level$level"`;
69
       fi ;
70
          fi ;
70
      fi;
71
        fi;
71
     # echo "$sh : make presentation"; leave the empty line after email for description
72
        # echo "$sh : make presentation"; leave the empty line after email for description
72
     # of the sheet in the search engine
73
        # of the sheet in the search engine
73
      echo "$title
74
        echo "$title
74
$desc
75
$desc
75
??,$dt
76
??,$dt
76
2
77
2
77
$level
78
$level
78
$domain, $domain1
79
$domain, $domain1
79
$keyword
80
$keyword
80
$sup
81
$sup
81
$email
82
$email
82
 
83
 
83
" > $tmptarget/$namesh.def;
84
" > $tmptarget/$namesh.def;
84
      cat $sh >> $tmptarget/$namesh.def;
85
        cat $sh >> $tmptarget/$namesh.def;
-
 
86
      fi;
85
     fi;
87
     fi;
86
   # else
88
     # else
87
   #  echo "$sh : EMPTY sheet";
89
     #  echo "$sh : EMPTY sheet";
88
    fi;
90
    fi;
89
   done;
91
   done;
90
   cd ../..;
92
   cd ../..;
91
 # else
93
 # else
92
 # echo "-----------------------NOTHING ---------- $cls ; $level ; $lang";
94
 # echo "-----------------------NOTHING ---------- $cls ; $level ; $lang";