|
From: <dwa...@us...> - 2012-06-11 13:22:50
|
Revision: 10829
http://zaf.svn.sourceforge.net/zaf/?rev=10829&view=rev
Author: dwaynebailey
Date: 2012-06-11 13:22:40 +0000 (Mon, 11 Jun 2012)
Log Message:
-----------
Factor out servers and allow a precommand
Mostly this is so that we can now use mozilla.locamotion.org
Modified Paths:
--------------
trunk/po/fftb/get-from-pootle.sh
trunk/po/fftb/push-to-pootle.sh
Modified: trunk/po/fftb/get-from-pootle.sh
===================================================================
--- trunk/po/fftb/get-from-pootle.sh 2012-06-11 13:19:27 UTC (rev 10828)
+++ trunk/po/fftb/get-from-pootle.sh 2012-06-11 13:22:40 UTC (rev 10829)
@@ -2,10 +2,13 @@
project=firefox
# Use instance: pootle or testpootle (2.1 and 2.2 instances)
-instance=pootle
+instance=mozilla
langs=$*
user=pootlesync
+server=pootle.locamotion.org
local_copy=.pootle_tmp
+manage_py_verbosity=2
+precommand=". ~andy/.virtualenvs/pootle/bin/activate;"
if [ $# -lt 1 ]; then
echo "$(basename $0) [lang(s)]"
@@ -32,15 +35,15 @@
option_project="--project=$project"
-sync_command="python /var/www/sites/$instance/Pootle/manage.py sync_stores $option_project $option_langs"
+sync_command="$precommand python /var/www/sites/$instance/Pootle/manage.py sync_stores --verbosity=$manage_py_verbosity $option_project $option_langs"
pootle_dir=/var/www/sites/$instance/podirectory/$project
# Sync project
-ssh $us...@po... $sync_command || exit
+ssh $user@$server $sync_command || exit
# Copy files across and disassemble phases
mkdir -p $local_copy/$project
-rsync -az --delete --exclude=".translation_index" $us...@po...:$pootle_dir/$bashlangs $local_copy/$project/ || exit
+rsync -az --delete --exclude=".translation_index" $user@$server:$pootle_dir/$bashlangs $local_copy/$project/ || exit
svndir=$(pwd)
cd $local_copy/$project
Modified: trunk/po/fftb/push-to-pootle.sh
===================================================================
--- trunk/po/fftb/push-to-pootle.sh 2012-06-11 13:19:27 UTC (rev 10828)
+++ trunk/po/fftb/push-to-pootle.sh 2012-06-11 13:22:40 UTC (rev 10829)
@@ -2,11 +2,14 @@
project=firefox
# Use instance: pootle or testpootle (2.1 and 2.2 instances)
-instance=pootle
+instance=mozilla
langs=$*
user=pootlesync
+server=pootle.locamotion.org
local_copy=.pootle_phases_tmp
phaselist=firefox.phaselist
+manage_py_verbosity=2
+precommand=". ~andy/.virtualenvs/pootle/bin/activate;"
if [ $# -lt 1 ]; then
echo "$(basename $0) [lang(s)]"
@@ -26,12 +29,12 @@
option_project="--project=$project"
-sync_command="python /var/www/sites/$instance/Pootle/manage.py sync_stores $option_project $option_langs"
-update_command="python /var/www/sites/$instance/Pootle/manage.py update_stores $option_project"
+sync_command="$precommand python /var/www/sites/$instance/Pootle/manage.py sync_stores --verbosity=${manage_py_verbosity} $option_project $option_langs"
+update_command="$precommand python /var/www/sites/$instance/Pootle/manage.py update_stores $option_project"
pootle_dir=/var/www/sites/$instance/podirectory/$project
# Sync project
-ssh $us...@po... $sync_command
+ssh $user@$server $sync_command
read -p "Do you wish to proceed? Do not if new translations have sync'd for your language." -N1 answer
if [ "$answer" != "y" ]; then
@@ -53,6 +56,6 @@
for lang in $langs
do
# FIXME only sync if we copied up correctly, this way we catch permission errors quickly
- rsync -az --no-g --chmod=Dg+s,ug+rw,o-rw,Fug+rw,o-rw --include="*.po" --delete $local_copy/$lang $us...@po...:$pootle_dir/
- ssh $us...@po... "$update_command --language=$lang"
+ rsync -az --no-g --chmod=Dg+s,ug+rw,o-rw,Fug+rw,o-rw --include="*.po" --delete $local_copy/$lang $user@$server:$pootle_dir/
+ ssh $user@$server "$update_command --language=$lang"
done
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|