package-translations/PREPARE_PACKAGE
Ludwig Nussel ba00f4aad8 Accepting request 424294 from home:Minton:branches:system:install:head
SVN repository URL in PREPARE_PACKAGE was outdated, as well as translations in .tar.bz2 pack. Both are up to date now, so delivery path of package translations to users can be tested before migrating those translations to Github/Weblate.

OBS-URL: https://build.opensuse.org/request/show/424294
OBS-URL: https://build.opensuse.org/package/show/system:install:head/package-translations?expand=0&rev=261
2016-09-02 13:59:43 +00:00

53 lines
1.4 KiB
Bash

#!/bin/bash
test -f package-translations.spec || { "cwd must contain package-translations.spec"; exit 1; }
if test -d "$MY_LCN_PACK_CHECKOUT"; then
echo "Updating $MY_LCN_PACK_CHECKOUT"
svn up $MY_LCN_PACK_CHECKOUT
else
echo "No \$MY_LCN_PACK_CHECKOUT set, will checkout temporarly"
svn export https://svn.opensuse.org/svn/opensuse-i18n/trunk/packages
export MY_LCN_PACK_CHECKOUT=$PWD/packages
fi
rm -rf mo
tar xf package-translations.tar.bz2
mv mo mo.old
mkdir mo
for file in $MY_LCN_PACK_CHECKOUT/*/po; do
lang=`echo $file | sed -e "s,/po,,; s,.*/,,"`
echo $file $lang
msgcat --use-first $file/*.po | msgfmt -o mo/package-translations-$lang.mo -
done
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 "-------------------------------------------------------------------"
timestamp=$(LC_ALL=POSIX TZ=Europe/Moscow date)
timestamp2=$(LC_ALL=POSIX TZ=Europe/Moscow date +"%Y-%m-%d")
user=$(osc whois | cut -d\" -f3)
user=$(echo $user)
echo "$timestamp - $user"
echo
echo "- automated update on $timestamp2"
echo
if head -n 6 $NAME.changes | grep -q "automated update" ; then
tail -n +6 $NAME.changes
else
cat $NAME.changes
fi
} > $NAME.changes.new
mv $NAME.changes.new $NAME.changes
exit 0