mc/maint/send-po
Pavel Roskin 55b23ed98d Prepend "new-" instead of appending ".new" so that special treatment
of files based on extensions is not affected.
2005-09-07 19:58:56 +00:00

38 lines
1016 B
Bash
Executable File

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