send-po 1008 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. # Generate mc.pot, upload it and *.po files to the FTP directory.
  3. set -e
  4. if ! test -d po; then
  5. echo "Run this script in the top level source directory" >&2
  6. exit 1
  7. fi
  8. DOMAIN=mc
  9. COPYRIGHT_HOLDER="Free Software Foundation, Inc."
  10. XGETTEXT_OPTIONS="--keyword=_ --keyword=N_ --keyword=Q_"
  11. XGETTEXT=xgettext
  12. MSGMERGE=msgmerge
  13. files=`find . -name '*.[ch]' | xargs $XGETTEXT $XGETTEXT_OPTIONS --output=- | \
  14. sed -ne '/^#:/{s/#://;s/:[0-9]*/\n/g;s/ //g;p;}' | sort -u | grep -v 'regex.c'`
  15. $XGETTEXT --default-domain=$DOMAIN --directory=. \
  16. --add-comments=TRANSLATORS: $XGETTEXT_OPTIONS \
  17. --copyright-holder="$COPYRIGHT_HOLDER" --output=po/new-mc.pot $files
  18. for file in po/*.po; do
  19. $MSGMERGE --output=po/new-`basename $file` $file po/new-mc.pot
  20. done
  21. # Location of the snapshot directory
  22. SITE="login.ibiblio.org"
  23. DIR="/public/ftp/pub/Linux/utils/file/managers/mc/po"
  24. scp po/new-* "$SITE:$DIR/"
  25. ssh $SITE "cd $DIR; for file in new-*; do mv -f \$file \${file#new-}; done"
  26. rm -f po/new-*