From c953e14ce464f4a2c0dd07431056b3efceff9ccb Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 19 Mar 2014 19:56:43 +0100 Subject: [PATCH] Only initialize transifex if there's no .tx directory Some git repositories have .tx directories, most have none. Handle both ways - check if .tx directory exists and create it with tx init if not. Change-Id: I7035fd6d130aabe553678e8b7aec78d33333715f --- .../files/slave_scripts/propose_translation_update.sh | 6 ++++-- .../slave_scripts/propose_translation_update_manuals.sh | 6 ++++-- .../files/slave_scripts/upstream_translation_update.sh | 6 ++++-- .../slave_scripts/upstream_translation_update_manuals.sh | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/modules/jenkins/files/slave_scripts/propose_translation_update.sh b/modules/jenkins/files/slave_scripts/propose_translation_update.sh index 91ffa7250c..da567cc09d 100755 --- a/modules/jenkins/files/slave_scripts/propose_translation_update.sh +++ b/modules/jenkins/files/slave_scripts/propose_translation_update.sh @@ -40,8 +40,10 @@ EOF set -e fi -# initialize transifex client -tx init --host=https://www.transifex.com +# Initialize the transifex client, if there's no .tx directory +if [ ! -d .tx ] ; then + tx init --host=https://www.transifex.com +fi tx set --auto-local -r ${PROJECT}.${PROJECT}-translations "${PROJECT}/locale//LC_MESSAGES/${PROJECT}.po" --source-lang en --source-file ${PROJECT}/locale/${PROJECT}.pot -t PO --execute # Pull all upstream translations diff --git a/modules/jenkins/files/slave_scripts/propose_translation_update_manuals.sh b/modules/jenkins/files/slave_scripts/propose_translation_update_manuals.sh index 81203ef5f1..cf5e16f4a9 100755 --- a/modules/jenkins/files/slave_scripts/propose_translation_update_manuals.sh +++ b/modules/jenkins/files/slave_scripts/propose_translation_update_manuals.sh @@ -50,8 +50,10 @@ EOF set -e fi -# Initialize transifex client -tx init --host=https://www.transifex.com +# Initialize the transifex client, if there's no .tx directory +if [ ! -d .tx ] ; then + tx init --host=https://www.transifex.com +fi # Generate pot one by one for FILE in ${DocFolder}/* diff --git a/modules/jenkins/files/slave_scripts/upstream_translation_update.sh b/modules/jenkins/files/slave_scripts/upstream_translation_update.sh index dd35216629..59e5928ac3 100755 --- a/modules/jenkins/files/slave_scripts/upstream_translation_update.sh +++ b/modules/jenkins/files/slave_scripts/upstream_translation_update.sh @@ -22,8 +22,10 @@ fi git config user.name "OpenStack Jenkins" git config user.email "jenkins@openstack.org" -# initialize transifex client -tx init --host=https://www.transifex.com +# Initialize the transifex client, if there's no .tx directory +if [ ! -d .tx ] ; then + tx init --host=https://www.transifex.com +fi tx set --auto-local -r ${PROJECT}.${PROJECT}-translations "${PROJECT}/locale//LC_MESSAGES/${PROJECT}.po" --source-lang en --source-file ${PROJECT}/locale/${PROJECT}.pot -t PO --execute # Pull all upstream translations diff --git a/modules/jenkins/files/slave_scripts/upstream_translation_update_manuals.sh b/modules/jenkins/files/slave_scripts/upstream_translation_update_manuals.sh index dc533ec4f6..d3d5735bc4 100755 --- a/modules/jenkins/files/slave_scripts/upstream_translation_update_manuals.sh +++ b/modules/jenkins/files/slave_scripts/upstream_translation_update_manuals.sh @@ -31,8 +31,10 @@ fi git config user.name "OpenStack Jenkins" git config user.email "jenkins@openstack.org" -# Initialize transifex client -tx init --host=https://www.transifex.com +# Initialize the transifex client, if there's no .tx directory +if [ ! -d .tx ] ; then + tx init --host=https://www.transifex.com +fi # Generate pot one by one for FILE in ${DocFolder}/*