2009-10-29 04:35:17 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
test -f package-translations.spec || { "cwd must contain package-translations.spec"; exit 1; }
|
2016-10-05 10:38:12 +02:00
|
|
|
PWD=$(pwd)
|
|
|
|
if test -d "$MY_PKG_I18N_CHECKOUT"; then
|
|
|
|
echo "Updating $MY_PKG_I18N_CHECKOUT"
|
|
|
|
cd $MY_PKG_I18N_CHECKOUT && git pull && cd $PWD
|
2009-10-29 04:35:17 +01:00
|
|
|
else
|
2016-10-05 10:38:12 +02:00
|
|
|
echo "No \$MY_PKG_I18N_CHECKOUT set, will checkout temporarly"
|
|
|
|
git clone https://github.com/opensuse/packages-i18n.git
|
|
|
|
export MY_PKG_I18N_CHECKOUT=$PWD/packages-i18n
|
2009-10-29 04:35:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf mo
|
2011-10-11 13:42:17 +02:00
|
|
|
tar xf package-translations.tar.bz2
|
|
|
|
mv mo mo.old
|
2009-10-29 04:35:17 +01:00
|
|
|
mkdir mo
|
2016-10-05 10:38:12 +02:00
|
|
|
for file in $MY_PKG_I18N_CHECKOUT/*/po; do
|
2009-10-29 04:35:17 +01:00
|
|
|
lang=`echo $file | sed -e "s,/po,,; s,.*/,,"`
|
|
|
|
echo $file $lang
|
2011-05-27 15:02:24 +02:00
|
|
|
msgcat --use-first $file/*.po | msgfmt -o mo/package-translations-$lang.mo -
|
2009-10-29 04:35:17 +01:00
|
|
|
done
|
2011-10-11 13:42:17 +02:00
|
|
|
if diff -ru mo.old mo; then
|
|
|
|
echo "no changes"
|
|
|
|
rm -rf mo mo.old
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
rm -f package-translations.tar.bz2
|
|
|
|
tar cfj package-translations.tar.bz2 mo
|
|
|
|
rm -rf mo mo.old
|
|
|
|
fi
|
|
|
|
|
|
|
|
NAME=package-translations
|
|
|
|
{
|
|
|
|
echo "-------------------------------------------------------------------"
|
2016-09-02 16:01:23 +02:00
|
|
|
timestamp=$(LC_ALL=POSIX TZ=UTC date)
|
|
|
|
timestamp2=$(LC_ALL=POSIX TZ=UTC date +"%Y-%m-%d")
|
2011-10-11 13:42:17 +02:00
|
|
|
user=$(osc whois | cut -d\" -f3)
|
|
|
|
user=$(echo $user)
|
|
|
|
echo "$timestamp - $user"
|
|
|
|
echo
|
|
|
|
echo "- automated update on $timestamp2"
|
|
|
|
echo
|
2016-10-05 10:38:12 +02:00
|
|
|
cat $NAME.changes
|
2011-10-11 13:42:17 +02:00
|
|
|
} > $NAME.changes.new
|
|
|
|
mv $NAME.changes.new $NAME.changes
|
2009-10-29 04:35:17 +01:00
|
|
|
|
|
|
|
exit 0
|