Subversion Repositories SvarDOS

Rev

Rev 123 | Rev 129 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
107 mv_fox 1
#!/bin/bash
2
 
3
SVNLSCHK='./svnlschk'
4
COREDIR='/srv/www/svarog386.viste.fr/repos/core'
5
HTMLFILE='/srv/www/svarog386.viste.fr/index-nls.htm'
109 mv_fox 6
INSTALLNLS='/root/svarog386/files/floppy/nls'
124 mv_fox 7
NLSTEMPDIR='/tmp/sv_nls'
8
NLSARCH='/srv/www/svarog386.viste.fr/nls.zip'
107 mv_fox 9
 
123 mv_fox 10
LANGSLIST="en      fr     it      pl     ru      si      tr"
11
LANGSLONG="default french italian polish russian slovene turkish"
107 mv_fox 12
 
13
##############################################################################
14
 
15
processfile() {
16
  f=$1
17
  pkgname=$2
18
  nlstype=$3
19
 
20
  echo "Package: $pkgname"
21
 
22
  if [ $nlstype -eq 0 ] ; then
23
    LANGS=$LANGSLIST
24
    ENCOUNT=`$SVNLSCHK $f en $nlstype`
124 mv_fox 25
    unzip -Cj "$f" nls/\* -d "$NLSTEMPDIR/nls/"
107 mv_fox 26
  else
27
    LANGS=$LANGSLONG
28
    ENCOUNT=`$SVNLSCHK $f default $nlstype`
124 mv_fox 29
    if [ $nlstype -eq 1 ] ; then
30
      unzip -Cj "$f" source/command/strings/\*.lng -d "$NLSTEMPDIR/nls/command/"
31
    else
32
      unzip -Cj "$f" source/command/strings/\*.err -d "$NLSTEMPDIR/nls/command/"
33
    fi
107 mv_fox 34
  fi
35
 
36
  echo "<tr>" >> $HTMLFILE
37
  echo "  <td class=\"pkg\">$pkgname</td>" >> $HTMLFILE
38
 
39
  for l in $LANGS
40
  do
41
 
42
  if [ $ENCOUNT -lt 0 ] ; then
43
    echo "  <td class=\"err\">ERR</td>" >> $HTMLFILE
44
  fi
45
 
46
  if [ $ENCOUNT -eq 0 ] ; then
47
    echo "  <td class=\"unsup\"></td>" >> $HTMLFILE
48
  fi
49
 
50
  if [ $ENCOUNT -gt 0 ] ; then
51
    NLSCOUNT=`$SVNLSCHK $f $l $nlstype`
52
    if [ $ENCOUNT -eq $NLSCOUNT ] ; then
53
      echo "  <td class=\"complete\">$NLSCOUNT/$ENCOUNT</td>" >> $HTMLFILE
54
    else
55
      echo "  <td class=\"incomplete\">$NLSCOUNT/$ENCOUNT</td>" >> $HTMLFILE
56
    fi
57
  fi
58
 
59
  done
60
 
61
  echo "</tr>" >> $HTMLFILE
62
}
63
 
64
##############################################################################
65
 
66
cat head.html > $HTMLFILE
67
 
68
echo "<tr>" >> $HTMLFILE
69
printf "  <th></th>" >> $HTMLFILE
70
 
71
for l in $LANGSLIST
72
do
73
  printf "<th>%s</th>" "$l" >> $HTMLFILE
74
done
75
 
76
printf "\n</tr>\n" >> $HTMLFILE
77
 
124 mv_fox 78
mkdir -p "$NLSTEMPDIR/nls/command"
79
 
109 mv_fox 80
# process INSTALL
81
mkdir /tmp/nls
82
cp $INSTALLNLS/install.* /tmp/nls/
83
CURDIR=`pwd`
84
cd /tmp
85
zip -qq -r install.zip nls
124 mv_fox 86
rm -rf /tmp/nls
109 mv_fox 87
cd $CURDIR
88
processfile /tmp/install.zip "install" 0
89
rm /tmp/install.zip
90
 
107 mv_fox 91
# process COMMAND (special NLS format)
92
processfile $COREDIR/command.zip "command (lng)" 1
93
processfile $COREDIR/command.zip "command (err)" 2
94
 
95
for f in $COREDIR/*.zip
96
do
97
 
98
  pkgname=`basename $f .zip`
99
  # skip COMMAND
100
  if [ $pkgname = "command" ] ; then
101
  continue;
102
  fi
103
 
104
  processfile $f $pkgname 0
105
 
106
done
107
 
108
cat tail.html >> $HTMLFILE
109
 
124 mv_fox 110
cd "$NLSTEMPDIR"
111
zip -9 -k -r "$NLSARCH" nls
112
rm -rf "$NLSTEMPDIR"
113
cd "$CURDIR"
114
 
107 mv_fox 115
exit 0