sflphone-translation-update 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. #
  3. # Script to update translations from Launchpad, create a patch and send by email
  4. # @See git-format-patch
  5. # @See git-send-email
  6. #
  7. # Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
  8. set -x
  9. # This is an environment variable provided by Jenkins. It points to the repository's root
  10. cd ${WORKSPACE}
  11. WORKING_DIR=${WORKSPACE}/gnome/po
  12. BZR_DIR=${WORKING_DIR}/tmp
  13. BZR=bzr
  14. MAKE=make
  15. BZR_BRANCH="lp:sflphone"
  16. EMAIL_TO="sflphone-dev@lists.savoirfairelinux.net"
  17. COMMIT_MSG="intl: automatic translations update"
  18. PATCH="0001-intl-automatic-translations-update.patch"
  19. # Clone Bazaar branch that contains Launchpad translations
  20. cd ${WORKING_DIR}
  21. if [ -e $BZR_DIR ] ; then
  22. # Remove the directory first
  23. rm -rf $BZR_DIR
  24. fi
  25. $BZR branch $BZR_BRANCH $BZR_DIR
  26. # Update the po files with the latest translations
  27. cd ${WORKSPACE}/gnome
  28. ./autogen.sh
  29. ./configure --prefix=/usr
  30. cd ${WORKING_DIR}
  31. cp $BZR_DIR/sflphone/*.po ${WORKING_DIR}
  32. # Compile the po files
  33. $MAKE
  34. # Build the patch
  35. git status
  36. if git diff-index HEAD . ; then
  37. git add *.po
  38. git commit -a -m "$COMMIT_MSG"
  39. git format-patch --to $EMAIL_TO HEAD~..HEAD
  40. # Send the patch
  41. git send-email \
  42. --8bit-encoding "utf-8" \
  43. --from "Jenkins CI <jenkins@savoirfairelinux.com>" \
  44. --to "<emmanuel.milou@savoirfairelinux.com>" \
  45. --confirm=never \
  46. $PATCH
  47. fi
  48. exit 0