From f856488f3aa704f6049daa0f65b3c2ae4760f27c Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Thu, 5 May 2016 20:53:54 +0200 Subject: [PATCH] Do not store source translation files in git Since we publish the source translation files (*.pot) now at tarballs.openstack.org, we can remove the storing of source translation files in git completly. Note that we still need to generate pot files - to check percentage of translated files. Change-Id: Ia9b3a65fbb902c2644e81d7567f5e5e166a66b6a --- jenkins/scripts/common_translation_update.sh | 21 ++++++------------- jenkins/scripts/propose_translation_update.sh | 14 +++++++++++++ 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/jenkins/scripts/common_translation_update.sh b/jenkins/scripts/common_translation_update.sh index d456c648ea..2f694148ce 100644 --- a/jenkins/scripts/common_translation_update.sh +++ b/jenkins/scripts/common_translation_update.sh @@ -480,25 +480,16 @@ function cleanup_po_files { } -# Remove obsolete files pot files, let's not store a pot file if it -# has no translations at all. +# Remove all pot files, we publish them to +# http://tarballs.openstack.org/translation-source/{name}/VERSION , +# let's not store them in git at all. function cleanup_pot_files { local modulename=$1 for i in $(find $modulename -name *.pot) ; do - local bi - local bi_po - local count_po - - # Get basename and remove .pot suffix from file name - bi=$(basename $i .pot) - bi_po="${bi}.po" - count_po=$(find $modulename -name "${bi_po}" | wc -l) - if [ $count_po -eq 0 ] ; then - # Remove file, it might be a new file unknown to git. - rm $i - git rm -f --ignore-unmatch $i - fi + # Remove file, it might be a new file unknown to git. + rm $i + git rm -f --ignore-unmatch $i done } diff --git a/jenkins/scripts/propose_translation_update.sh b/jenkins/scripts/propose_translation_update.sh index d0f92e4b4c..180c08614c 100755 --- a/jenkins/scripts/propose_translation_update.sh +++ b/jenkins/scripts/propose_translation_update.sh @@ -31,18 +31,25 @@ function propose_manuals { # repository. case "$PROJECT" in openstack-manuals) + cleanup_pot_files "doc" compress_manual_po_files "doc" 1 ;; api-site) + cleanup_pot_files "api-ref-guides" compress_manual_po_files "api-ref-guides" 0 + cleanup_pot_files "api-quick-start" compress_manual_po_files "api-quick-start" 0 + cleanup_pot_files "api-ref" compress_manual_po_files "api-ref" 0 + cleanup_pot_files "openstack-firstapp" compress_manual_po_files "openstack-firstapp" 0 ;; ha-guide|operations-guide) + cleanup_pot_files "doc" compress_manual_po_files "doc" 0 ;; security-doc) + cleanup_pot_files "security-guide" compress_manual_po_files "security-guide" 0 ;; esac @@ -65,6 +72,8 @@ function propose_training_guides { # Pull updated translations from Zanata. pull_from_zanata "$PROJECT" + # Remove pot files + cleanup_pot_files "doc/upstream-training" # Compress downloaded po files compress_po_files "doc/upstream-training" @@ -121,6 +130,8 @@ function handle_python_django { pull_from_zanata "$project" propose_releasenotes "$ZANATA_VERSION" for modulename in $module_names; do + # Note that we need to generate the pot files so that we + # can calculate how many strings are translated. case "$kind" in django) # Update the .pot file @@ -145,6 +156,9 @@ function propose_releasenotes { # they get pushed to the translation server. if [[ "$version" == "master" && -f releasenotes/source/conf.py ]]; then + + # Note that we need to generate these so that we can calculate + # how many strings are translated. extract_messages_releasenotes # Remove obsolete files.