Commit 022f09db authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Push pot template updates to launchpad

parent ae6c1c88
...@@ -7,7 +7,7 @@ Standards-Version: 3.9.1 ...@@ -7,7 +7,7 @@ Standards-Version: 3.9.1
Package: custom-site-mahara-langpacks Package: custom-site-mahara-langpacks
Architecture: all Architecture: all
Depends: ${misc:Depends}, apache2, php5-cli, perl, bash, debconf, git-core, libhtml-tiny-perl, liblocale-po-perl, libwww-perl Depends: ${misc:Depends}, apache2, php5-cli, perl, bash, debconf, git-core, libhtml-tiny-perl, liblocale-po-perl, libwww-perl, bzr
Description: Mahara langpack repository scripts Description: Mahara langpack repository scripts
Scripts to download mahara langpacks from gitorious, clean them up, and Scripts to download mahara langpacks from gitorious, clean them up, and
make them available for HTTP download. make them available for HTTP download.
...@@ -18,20 +18,22 @@ fi ...@@ -18,20 +18,22 @@ fi
WORK=${DATA}/templates WORK=${DATA}/templates
GITDIR=${WORK}/git GITDIR=${WORK}/git
TEMP=${WORK}/temp TEMP=${WORK}/temp
OUT=${DATA}/po
[ ! -d ${WORK} ] && mkdir ${WORK} [ ! -d ${WORK} ] && mkdir ${WORK}
[ ! -d ${TEMP} ] && mkdir ${TEMP} [ ! -d ${TEMP} ] && mkdir ${TEMP}
[ ! -d ${OUT} ] && mkdir ${OUT}
[ ! -d ${DOCROOT}/pot ] && mkdir ${DOCROOT}/pot [ ! -d ${DOCROOT}/pot ] && mkdir ${DOCROOT}/pot
remote='git://gitorious.org/mahara/mahara.git' mahararemote='git://gitorious.org/mahara/mahara.git'
if [ ! -d ${GITDIR} ]; then if [ ! -d ${GITDIR} ]; then
echo "git clone ${remote} ${GITDIR}" echo "git clone ${mahararemote} ${GITDIR}"
git clone --quiet ${remote} ${GITDIR} git clone --quiet ${mahararemote} ${GITDIR}
fi fi
[ ! -d "${WORK}/mahara-lang-bzr" ] && bzr init-repo ${WORK}/mahara-lang-bzr
BZR=${WORK}/mahara-lang-bzr
cd ${GITDIR} cd ${GITDIR}
git fetch --quiet origin git fetch --quiet origin
...@@ -86,8 +88,9 @@ for branch in ${branches} ; do ...@@ -86,8 +88,9 @@ for branch in ${branches} ; do
continue continue
fi fi
[ ! -d ${OUT}/${branch} ] && mkdir ${OUT}/${branch} # Output into a copy of the launchpad mahara-lang repo
outputdir=${OUT}/${branch}/mahara [ ! -d ${BZR}/${branch} ] && bzr branch lp:~mahara-core/mahara-lang/${branch} ${BZR}/${branch}
outputdir=${BZR}/${branch}/mahara
[ ! -d ${outputdir} ] && mkdir ${outputdir} [ ! -d ${outputdir} ] && mkdir ${outputdir}
outputfile=${outputdir}/mahara.pot outputfile=${outputdir}/mahara.pot
...@@ -97,8 +100,22 @@ for branch in ${branches} ; do ...@@ -97,8 +100,22 @@ for branch in ${branches} ; do
/usr/bin/php ${SCRIPTS}/php-po.php ${langpack} ${langpack} ${outputfile} /usr/bin/php ${SCRIPTS}/php-po.php ${langpack} ${langpack} ${outputfile}
if [ -f ${outputfile} ]; then if [ -f ${outputfile} ]; then
cd ${OUT}/${branch} cd ${BZR}/${branch}
diffs=`bzr diff mahara/mahara.pot`
if [ ! -z "${diffs}" ]; then
# 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
# Push template to lp:mahara-lang
bzr add mahara/mahara.pot
bzr commit -m "Update template to ${remotecommit}"
bzr push lp:~mahara-core/mahara-lang/${branch}
fi
cd ${GITDIR} cd ${GITDIR}
fi fi
......
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