]> git.lyx.org Git - lyx.git/blob - development/tools/updatestats.sh
e64ee0aea6bcc2844586cf97de8b6df8c977cce7
[lyx.git] / development / tools / updatestats.sh
1 #!/bin/sh
2 # A script to update the LyX i18n.inc statistics
3
4 FARM="/cvs/lyx-www/farm/cookbook/LyX";
5
6 # Sanity check
7 if [ ! -f "$FARM/i18n.php" ]; then 
8   echo "$FARM does not look like LyX's www tree!";
9   exit 1;
10 fi
11
12 # Get us to the root of the tree we are in.
13 MYDIR=${0%updatestats.sh};
14 if [ -n "$MYDIR" ]; then
15   cd $MYDIR;
16 fi
17 LYXROOT=$(pwd);
18 cd ../../;
19
20 # Are we in trunk or branch?
21 TRUNK="TRUE";
22 if ls status.* 2>/dev/null | grep -q status; then 
23   TRUNK="";
24 fi
25
26 # Sanity check
27 if ! cd po/; then 
28   echo "Cannot cd to po/ directory!";
29   pwd
30   exit 1;
31 fi
32
33 echo Running make i18n.inc...
34 make i18n.inc;
35 if [ -n "$TRUNK" ]; then
36   mv i18n.inc i18n_trunk.inc
37   I18NFILE=i18n_trunk.inc;
38 else
39   I18NFILE=i18n.inc;
40 fi
41
42 if ! cd $FARM; then
43   echo "Unable to cd to $FARM!";
44   exit 1;
45 fi
46
47 echo
48 echo Updating the www-user tree...
49 svn up
50
51 echo Copying $I18NFILE...;
52 cp $LYXROOT/po/$I18NFILE .;
53
54 echo Committing...;
55 svn commit -m "* $I18NFILE: update stats" $I18NFILE;
56
57 echo DONE!