Commit 04bbd9b5 authored by Richard Mansfield's avatar Richard Mansfield

Changes to .pot updater:

Only update .pot when there are substantive (msgid) changes
Fix error when calling bzr diff on new files
Change to the correct directory before committing new .po files
Restrict processing to fr.po for testing purposes
parent fc83826b
...@@ -112,10 +112,12 @@ for branch in ${branches} ; do ...@@ -112,10 +112,12 @@ for branch in ${branches} ; do
if [ -f ${outputfile} ]; then if [ -f ${outputfile} ]; then
cd ${BZR}/${branch} cd ${BZR}/${branch}
diffs=`bzr diff mahara/mahara.pot` diffs=`bzr diff mahara/mahara.pot | grep "[+-]msg"`
if [ ! -z "${diffs}" ]; then if [ -z "${diffs}" ]; then
bzr revert
# Update copy of template in webroot # Update copy of template in webroot
tar zcf ${DOCROOT}/pot/${branch}.tar.gz mahara/mahara.pot tar zcf ${DOCROOT}/pot/${branch}.tar.gz mahara/mahara.pot
...@@ -135,17 +137,32 @@ for branch in ${branches} ; do ...@@ -135,17 +137,32 @@ for branch in ${branches} ; do
bzr pull bzr pull
fi fi
for po in `ls ${BZR}/${exportbranch}/mahara/*.po`; do cd ${BZR}/${branch}
# for po in `ls ${BZR}/${exportbranch}/mahara/*.po`; do
for po in `ls ${BZR}/${exportbranch}/mahara/fr.po`; do
pobase=${po##*/} pobase=${po##*/}
/usr/bin/perl ${SCRIPTS}/ $po mahara/mahara.pot mahara/$pobase /usr/bin/perl ${SCRIPTS}/ $po mahara/mahara.pot mahara/$pobase
status=`bzr status -S mahara/$pobase | grep ?`
if [ ! -z "$status" ]; then
# New file
bzr add mahara/$pobase
podiffs=`bzr diff mahara/${pobase} | grep "[+-]msg"`
if [ -z "$podiffs" ] ; then
# Nothing worth committing
bzr revert mahara/$pobase
done done
podiffs=`bzr diff mahara` podiffs=`bzr diff mahara`
if [ ! -z "$podiffs" ] ; then if [ ! -z "$podiffs" ] ; then
bzr add mahara bzr add mahara
bzr commit -m "Update translations to ${remotecommit}" bzr commit -m "Update translations to ${remotecommit}"
fi fi
fi fi
# Push everything to lp:mahara-lang # Push everything to lp:mahara-lang
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment