sflphone-translation-push-template 891 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. #
  3. # Script to push up-to-date template file to Launchpad.
  4. #
  5. # Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
  6. set -x
  7. # This is an environment variable provided by Jenkins. It points to the repository's root
  8. cd ${WORKSPACE}
  9. WORKING_DIR=${WORKSPACE}/gnome/po
  10. BZR_DIR=${WORKING_DIR}/tmp
  11. BZR=bzr
  12. BZR_BRANCH="lp:sflphone"
  13. # Clone Bazaar branch that contains Launchpad translations
  14. cd ${WORKING_DIR}
  15. if [ -e $BZR_DIR ] ; then
  16. # Remove the directory first
  17. rm -rf $BZR_DIR
  18. fi
  19. $BZR branch $BZR_BRANCH $BZR_DIR
  20. # Update the template file with the latest strings
  21. cd ${WORKSPACE}/gnome
  22. ./autogen.sh
  23. ./configure --prefix=/usr
  24. cd ${WORKING_DIR}
  25. make sflphone.pot
  26. # Add the new template file to the Bazaar repository
  27. cp sflphone.pot $BZR_DIR/sflphone
  28. cd $BZR_DIR/sflphone
  29. $BZR commit sflphone.pot --message "[Translations] Update POT file"
  30. $BZR push $BZR_BRANCH
  31. exit 0;