Subversion Repositories SvarDOS

Rev

Rev 123 | Rev 129 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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