Having spent a little time battling the details around updating the POT
files automatically, I think I finally have it working. I thought I
would share the script so others don't have to go through the same
battles.
This is far from elegant, and a variant of the build script I posted on
the wiki. But there are a few little details. In this case I again
updated the po's individually. In the case of the build I wanted the
logs. In this case, it prevents me from having to build long strings of
languages for git add and update_po.
Note that since I am pushing back to git, I use the ssh:// clone variant
instead of git://
Script below
--McD
#!/bin/sh
#
# Script to update POT and PO files and push
# back to git
#
# ----------------------------------------------------------
# Modify the following variables for your situation
#
# List of subdirectories to ignore
NOLANGS="build tmp pot po publican.cfg README en-US"
# Scratch directory on local machine for work
WORKDIR="/home/jjmcd/Projects/Release-Notes/F13/makepot"
# Document to build *** NOTE ** If your document is not
# in the docs/ subtree in git, you will need to modify
# the git clone statement below
DOC="release-notes"
#
# End of variables to modify
# ----------------------------------------------------------
#
# Move to scratch directory
cd $WORKDIR
# and clean it out
rm -Rf *
# Let's check how long this takes
echo "Start " `date` >time.txt
git clone
ssh://git.fedorahosted.org/git/docs/$DOC.git
pushd $DOC
cp -R en-US ..
git checkout --track -b f13 origin/f13
rm -Rf en-US
mv ../en-US .
rm -Rf pot
publican update_pot
git add en-US/ pot/
# For all subdirectories
for LANG in * ; do
# Figure out whether this one is one of those to ignore
DOIT=1
for TEST in $NOLANGS
do
if [ $LANG == $TEST ] ; then
DOIT=0
fi
done
# Do this directory
if [ $DOIT == 1 ]
then
publican update_po --lang=${LANG}
git add ${LANG}/
fi
done
git commit -m "Updated POT files"
git push origin f13
popd
# And now the finish time
echo " End " `date` >>time.txt