2 # A script to update the LyX i18n.inc statistics
4 # The script expects an environment variable FARM that
5 # will provide it with the location of the LyX www tree.
7 if [ -z "$FARM" ]; then
8 echo "You must set the FARM variable to run this script, e.g.:";
9 echo "# FARM=/cvs/lyx-www/ bash updatestats.sh";
14 FARM="$FARM/farm/cookbook/LyX";
16 if [ ! -f "$FARM/i18n.php" ]; then
17 echo "$FARM does not look like LyX's www tree!";
21 # Get us to the root of the tree we are in.
22 MYDIR=${0%updatestats.sh};
23 if [ -n "$MYDIR" ]; then
29 # Are we in trunk or branch?
31 if ls status.* 2>/dev/null; then
37 echo "Cannot cd to po/ directory!";
42 echo Running make i18n.inc...
44 if [ -n "$TRUNK" ]; then
45 mv i18n.inc i18n_trunk.inc
46 I18NFILE=i18n_trunk.inc;
52 echo "Unable to cd to $FARM!";
56 # Are we under svn or git?
58 if [ -d .git/ ]; then GIT="TRUE"; fi
61 echo Updating the www-user tree...
64 echo Copying $I18NFILE...;
65 cp "$LYXROOT/po/$I18NFILE" .;
68 if [ -z "$GIT" ]; then
69 svn commit -m "* $I18NFILE: update stats" $I18NFILE;
71 git commit -m "* $I18NFILE: update stats" $I18NFILE;