txpush.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. # Make sure we can make Transifex and git operations from the Calamares Docker+Jenkins environment.
  3. cp ~/jenkins-master/.transifexrc ~
  4. cp ~/jenkins-master/.gitconfig ~
  5. cp -R ~/jenkins-master/.ssh ~
  6. cd "$WORKSPACE"
  7. git config --global http.sslVerify false
  8. export QT_SELECT=5
  9. lupdate src/ -ts -no-obsolete lang/calamares_en.ts
  10. # Arch
  11. # PYGETTEXT=/usr/lib/python3.5/Tools/i18n/pygettext.py
  12. # Ubuntu
  13. PYGETTEXT=pygettext3
  14. for MODULE_DIR in `find src/modules -maxdepth 1 -mindepth 1 -type d`; do
  15. FILES=(${MODULE_DIR}/*.py)
  16. if [ ${#FILES[@]} -gt 0 ]; then
  17. MODULE_NAME=$(basename ${MODULE_DIR})
  18. if [ -d ${MODULE_DIR}/lang ]; then
  19. ${PYGETTEXT} -p ${MODULE_DIR}/lang -d ${MODULE_NAME} ${MODULE_DIR}/*.py
  20. if [ -f ${MODULE_DIR}/lang/${MODULE_NAME}.pot ]; then
  21. tx set -r calamares.${MODULE_NAME} --source -l en ${MODULE_DIR}/lang/${MODULE_NAME}.pot
  22. tx push --force --source --no-interactive -r calamares.${MODULE_NAME}
  23. fi
  24. fi
  25. fi
  26. done
  27. tx push --force --source --no-interactive -r calamares.calamares-master