/[d-i]/trunk/scripts/gen_stats
ViewVC logotype

Diff of /trunk/scripts/gen_stats

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7026 by barbier, Wed Dec 24 08:38:28 2003 UTC revision 9117 by barbier, Tue Feb 24 00:02:21 2004 UTC
# Line 23  remove_pot () Line 23  remove_pot ()
23      find $DI_HOME \( -name \*.po -o -name templates.pot \) | xargs -n 20 rm -f      find $DI_HOME \( -name \*.po -o -name templates.pot \) | xargs -n 20 rm -f
24      cd $DI_HOME/base-config      cd $DI_HOME/base-config
25      cvs -z3 update -P -d -A >/dev/null 2>&1      cvs -z3 update -P -d -A >/dev/null 2>&1
     [ -f po/base-config.pot ] && rm -f po/base-config.pot  
     make -C po base-config.pot >/dev/null 2>&1  
26      cd $DI_HOME/debian-installer      cd $DI_HOME/debian-installer
27      cvs -z3 update -P -d -A >/dev/null 2>&1      cvs -z3 update -P -d -A >/dev/null 2>&1
28        cd $DI_HOME/tasksel
29        svn update >/dev/null 2>&1
30      cd $oldcwd      cd $oldcwd
31  }  }
32    
# Line 35  finaldestdir=$HOME/public_html/debian-in Line 35  finaldestdir=$HOME/public_html/debian-in
35  destdir=$finaldestdir.new  destdir=$finaldestdir.new
36  rm -rf $destdir 2>/dev/null  rm -rf $destdir 2>/dev/null
37  mkdir -p $destdir  mkdir -p $destdir
38    mkdir $destdir/POT
39  for f in `find * -name templates.pot | sort`  for f in `find * -name templates.pot | sort`
40  do  do
41      dir=`echo $f | sed -e 's,/debian/po/templates.pot,,'`      dir=`echo $f | sed -e 's,/debian/po/templates.pot,,'`
42      test "$dir" = "$f" && continue      test "$dir" = "$f" && continue
     nstr=`msgfmt -o /dev/null --statistics $f 2>&1 | sed -e 's/ fuzzy translations*/f/' -e 's/ untranslated messages*/u/' -e 's/ translated messages*/t/' | sed -e 's/[^0-9tfu]//g' | sed -e 's/^0t//' -e 's/u$//'`  
     totstr=`expr ${totstr:-0} + $nstr`  
43      for p in $dir/debian/po/*.po      for p in $dir/debian/po/*.po
44      do      do
45          [ -r $p ] || continue          [ -r $p ] || continue
         msgfmt -o /dev/null $p >/dev/null 2>&1 || continue  
46          l=`echo $p | sed -e 's,.*/,,' -e 's/\.po$//'`          l=`echo $p | sed -e 's,.*/,,' -e 's/\.po$//'`
47          test -d $destdir/$l || mkdir $destdir/$l          test -d $destdir/$l || mkdir $destdir/$l
48            msgfmt -o /dev/null $p >/dev/null 2>&1 || continue
49          eval "x1$l=`msgfmt -o /dev/null --statistics $p 2>&1 | sed -e 's/ fuzzy translations*/f/' -e 's/ untranslated messages*/u/' -e 's/ translated messages*/t/' | sed -e 's/[^0-9tfu]//g'`"          eval "x1$l=`msgfmt -o /dev/null --statistics $p 2>&1 | sed -e 's/ fuzzy translations*/f/' -e 's/ untranslated messages*/u/' -e 's/ translated messages*/t/' | sed -e 's/[^0-9tfu]//g'`"
50      done      done
51      ( cd $dir; debconf-updatepo 2>/dev/null )      ( cd $dir; debconf-updatepo 2>/dev/null )
52        cp $f $destdir/POT/`echo $dir | sed -e 's,.*/,,'`.pot
53        nstr=`msgfmt -o /dev/null --statistics $f 2>&1 | sed -e 's/ fuzzy translations*/f/' -e 's/ untranslated messages*/u/' -e 's/ translated messages*/t/' | sed -e 's/[^0-9tfu]//g' | sed -e 's/^0t//' -e 's/u$//'`
54        totstr=`expr ${totstr:-0} + $nstr`
55      for p in $dir/debian/po/*.po      for p in $dir/debian/po/*.po
56      do      do
57          [ -r $p ] || continue          [ -r $p ] || continue
# Line 76  do Line 78  do
78      done      done
79  done  done
80    
81      f=base-config/po/base-config.pot  #  Special cases
82      dir=base-config  for dir in base-config tasksel tasksel/tasks
83      nstr=`msgfmt -o /dev/null --statistics $f 2>&1 | sed -e 's/ fuzzy translations*/f/' -e 's/ untranslated messages*/u/' -e 's/ translated messages*/t/' | sed -e 's/[^0-9tfu]//g' | sed -e 's/^0t//' -e 's/u$//'`  do
84      totstr=`expr ${totstr:-0} + $nstr`      case $dir in
85          tasksel/tasks ) f=$dir/po/debian-tasks.pot ;;
86          * ) f=$dir/po/$dir.pot ;;
87        esac
88      for p in $dir/po/*.po      for p in $dir/po/*.po
89      do      do
90          [ -r $p ] || continue          [ -r $p ] || continue
         msgfmt -o /dev/null $p >/dev/null 2>&1 || continue  
91          l=`echo $p | sed -e 's,.*/,,' -e 's/\.po$//'`          l=`echo $p | sed -e 's,.*/,,' -e 's/\.po$//'`
92          test -d $destdir/$l || mkdir $destdir/$l          test -d $destdir/$l || mkdir $destdir/$l
93            msgfmt -o /dev/null $p >/dev/null 2>&1 || continue
94          eval "x1$l=`msgfmt -o /dev/null --statistics $p 2>&1 | sed -e 's/ fuzzy translations*/f/' -e 's/ untranslated messages*/u/' -e 's/ translated messages*/t/' | sed -e 's/[^0-9tfu]//g'`"          eval "x1$l=`msgfmt -o /dev/null --statistics $p 2>&1 | sed -e 's/ fuzzy translations*/f/' -e 's/ untranslated messages*/u/' -e 's/ translated messages*/t/' | sed -e 's/[^0-9tfu]//g'`"
95      done      done
96      ( cd $dir/po; make *.po >/dev/null 2>&1 )      case "$dir" in
97          base-config )
98            ( cd $dir/po; rm -f base-config.pot >/dev/null 2>&1; make *.po >/dev/null 2>&1 )
99            ;;
100          tasksel )
101            ( cd $dir; make updatepo >/dev/null 2>&1 )
102            ;;
103          tasksel/tasks )
104            ( cd $dir; make updatetaskspo >/dev/null 2>&1 )
105            ;;
106        esac
107        cp $f $destdir/POT/`echo $dir | sed -e 's,/,_,g'`.pot
108        nstr=`msgfmt -o /dev/null --statistics $f 2>&1 | sed -e 's/ fuzzy translations*/f/' -e 's/ untranslated messages*/u/' -e 's/ translated messages*/t/' | sed -e 's/[^0-9tfu]//g' | sed -e 's/^0t//' -e 's/u$//'`
109        totstr=`expr ${totstr:-0} + $nstr`
110      for p in $dir/po/*.po      for p in $dir/po/*.po
111      do      do
112          [ -r $p ] || continue          [ -r $p ] || continue
# Line 111  done Line 129  done
129          echo $x2 | grep '[fu]' >/dev/null 2>&1 || continue          echo $x2 | grep '[fu]' >/dev/null 2>&1 || continue
130          eval "test \"\$x1$l\" = \"\$x2\" || u='*'"          eval "test \"\$x1$l\" = \"\$x2\" || u='*'"
131          echo "$u $dir/po: $x2  [$t]" >> $destdir/$l/STATUS.utf8.txt          echo "$u $dir/po: $x2  [$t]" >> $destdir/$l/STATUS.utf8.txt
132          cp $p $destdir/$l/base-config_po_$l.po          cp $p $destdir/$l/`echo ${dir} | sed -e 's,/,_,g'`_po_$l.po
133      done      done
134    done
135    
136  langs=`( cd $destdir && echo [a-z][a-z]* )`  langs=`( cd $destdir && echo [a-z][a-z]* )`
137  for l in $langs  for l in $langs
# Line 211  do Line 230  do
230      done      done
231  done  done
232    
233      dir=base-config  #  Special cases
234    for dir in base-config tasksel tasksel/tasks
235    do
236      for l in $langs      for l in $langs
237      do      do
238          if test -f "$dir/po/$l.po"; then          if test -f "$dir/po/$l.po"; then
# Line 221  done Line 242  done
242              echo "Missing file: $dir/po/$l.po" >> $destdir/$l/STATUS.utf8.txt              echo "Missing file: $dir/po/$l.po" >> $destdir/$l/STATUS.utf8.txt
243          fi          fi
244      done      done
245    done
246    
247  #  Now merge all files into a single PO file  #  Now merge all files into a single PO file
248  cd $DI_HOME/debian-installer  cd $DI_HOME/debian-installer
# Line 229  for l in $langs Line 251  for l in $langs
251  do  do
252      perl -I $webwmldir/Perl scripts/gettext-helper export $l >/dev/null 2>&1      perl -I $webwmldir/Perl scripts/gettext-helper export $l >/dev/null 2>&1
253      echo >> $destdir/$l/STATUS.utf8.txt      echo >> $destdir/$l/STATUS.utf8.txt
254        eval "stats=\`expr \${tot_t_$l}00 / $totstr\`"
255        po_merged=
256      if grep '^"Content-Type: \\n"$' po/$l.po >/dev/null 2>&1; then      if grep '^"Content-Type: \\n"$' po/$l.po >/dev/null 2>&1; then
257          echo "Some PO files are invalid, $l.po cannot be generated" >> $destdir/$l/STATUS.utf8.txt          echo "Some PO files are invalid, $l.po cannot be generated" >> $destdir/$l/STATUS.utf8.txt
258            po_merged='(Some PO files are invalid)'
259      else      else
260          x2=`msgfmt -o /dev/null --statistics po/$l.po 2>&1 | sed -e 's/ fuzzy translations*/f/' -e 's/ untranslated messages*/u/' -e 's/ translated messages*/t/' | sed -e 's/[^0-9tfu]//g'`          x2=`msgfmt -o /dev/null --statistics po/$l.po 2>&1 | sed -e 's/ fuzzy translations*/f/' -e 's/ untranslated messages*/u/' -e 's/ translated messages*/t/' | sed -e 's/[^0-9tfu]//g'`
261          echo "All debian-installer PO files merged together: $l.po  $x2" >> $destdir/$l/STATUS.utf8.txt          echo "All debian-installer PO files merged together: $l.po  $x2" >> $destdir/$l/STATUS.utf8.txt
262          cp po/$l.po $destdir/$l/$l.po          cp po/$l.po $destdir/$l/$l.po
263            if echo $x2 | grep '[fu]' >/dev/null 2>&1; then
264                [ "$stats" = 100 ] && po_merged="(Merged PO file: $x2)"
265            fi
266      fi      fi
267      echo >> $destdir/$l/STATUS.utf8.txt      echo >> $destdir/$l/STATUS.utf8.txt
     eval "stats=\`expr \${tot_t_$l}00 / $totstr\`"  
268      eval "echo Global statistics: \${tot_t_$l}t\${tot_f_$l}f\${tot_u_$l}u'   '\(${stats}%\) >> $destdir/$l/STATUS.utf8.txt"      eval "echo Global statistics: \${tot_t_$l}t\${tot_f_$l}f\${tot_u_$l}u'   '\(${stats}%\) >> $destdir/$l/STATUS.utf8.txt"
269      echo >> $destdir/$l/STATUS.utf8.txt      echo >> $destdir/$l/STATUS.utf8.txt
270      echo "PO files are available at http://people.debian.org/~barbier/d-i/l10n/$l/" >> $destdir/$l/STATUS.utf8.txt      echo "PO files are available at http://people.debian.org/~barbier/d-i/l10n/$l/" >> $destdir/$l/STATUS.utf8.txt
271      echo >> $destdir/$l/STATUS.utf8.txt      echo >> $destdir/$l/STATUS.utf8.txt
272      echo "Files fetched and report generated on: "`date -u` >> $destdir/$l/STATUS.utf8.txt      echo "Files fetched and report generated on: "`date -u` >> $destdir/$l/STATUS.utf8.txt
273      echo "${stats}% $l" >> $destdir/rank      echo "${stats}% $l  $po_merged" >> $destdir/rank
274      ln -s ../README.txt $destdir/$l/README.txt      ln -s ../README.txt $destdir/$l/README.txt
275      cat >> $destdir/$l/STATUS.utf8.txt <<'EOT'      cat >> $destdir/$l/STATUS.utf8.txt <<'EOT'
276    

Legend:
Removed from v.7026  
changed lines
  Added in v.9117

  ViewVC Help
Powered by ViewVC 1.1.5