#!/bin/bash # Checks for changes in the translation directory, updates them and checks # them in to the OLAT cvs # 19.11.2004 # gnaegi@id.unizh.ch export CVSROOT=:ext:olat@cvs.olat.org:/usr/local/cvs/ export CVS_RSH=ssh if [ "$1" = "" ]; then echo "Usage: checkin_translations.sh LOCALE Example: checkin_translations.sh en" exit; fi #read locale as input parameter LOCALE=$1 LOG=/usr/local/olat/translationlog/$LOCALE-trans-$(date +%Y%m%d).log cd /usr/local/olat/olat3 echo -e "Starting CVS update for locale $LOCALE\n" >> $LOG echo -e "---------------------------------------\n" >> $LOG UPDATE=`cvs update webapp/i18n/default/$LOCALE/` > /dev/null 2> /dev/null echo $UPDATE | grep "^M.*" >> $LOG echo $UPDATE | grep "^P.*" >> $LOG CONFLICTS=`echo $UPDATE | grep "^C.*"` 2> /dev/null # abort when any conflicts are found and send email to developers if [ "$CONFLICTS" != "" ]; then echo "****** Conflicts found in" >> $LOG echo $CONFLICTS >> $LOG echo "****** Fix them manually !!" >> $LOG echo $CONFLICTS | mail -s "Conflicts found while updating locale $LOCALE - fix them" -r "olat@olat.unizh.ch" id_olat@id.unizh.ch exit; fi echo -e "Starting CVS diffs for locale $LOCALE\n" >> $LOG echo -e "-------------------------------------\n" >> $LOG cvs diff webapp/i18n/default/$LOCALE/ >> $LOG 2> /dev/null # TODO: check for conflicts here, proceed only when no conflicts are here echo -e "Checking in changes for locale $LOCALE\n" >> $LOG echo -e "------------------ -------------------\n" >> $LOG cvs ci -m "Translation changes in $LOCALE" webapp/i18n/default/$LOCALE/ >> $LOG 2> /dev/null echo -e "\n\n" >> $LOG