e02199
#!/bin/bash
e02199
# This checks out and builds the language sources.  The lightning source needs
e02199
# to already be unpacked
e02199
#lver=`awk '/^%global *lightning_ver/ { print $3; exit }' thunderbird.spec`
e02199
tbver=`awk '/^Version:/ { print $2; exit }' thunderbird.spec`
e02199
#tag=CALENDAR_${lver//./_}_RELEASE
e02199
tag=THUNDERBIRD_${tbver//./_}_RELEASE
e02199
branch=`awk '/^%define *tarballdir/ { print $3; exit }' thunderbird.spec`
e02199
locales=$PWD/thunderbird-${tbver}/${branch}/calendar/locales/shipped-locales
e02199
#locales=$PWD/shipped-locales
e02199
if [ ! -f $locales ]
e02199
then
e02199
  echo "ERROR: missing $locales, try fedpkg prep first"
e02199
  exit 1
e02199
fi
e02199
[ ! -d l10n ] && mkdir l10n
e02199
cd l10n
e02199
for lang in $(<$locales)
e02199
do
e02199
  if [ -d $lang ]
e02199
  then
e02199
    pushd $lang
e02199
    hg pull
e02199
    hg update $tag
a8a561
    #hg update
e02199
    popd
e02199
  else
e02199
    hg clone -u $tag http://hg.mozilla.org/releases/l10n/mozilla-release/$lang
a8a561
    #hg clone http://hg.mozilla.org/l10n-central/$lang
e02199
  fi
e02199
done
a8a561
cd ..
a8a561
# Need to merge by compare-locale tool
a8a561
# More info here: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/compare-locales
a8a561
# how to get compare-locales: sudo easy_install -U compare-locales
a8a561
a8a561
# Make copy to merge with
a8a561
rm -rf l10n-merged
a8a561
cp -R l10n l10n-merged
a8a561
for lang in $(<$locales)
a8a561
do
a8a561
  compare-locales --merge l10n-merged/$lang $PWD/thunderbird-${tbver}/${branch}/calendar/locales/l10n.ini l10n $lang
a8a561
done
a8a561
e02199
e02199
# Tar up, minus the mercurial files
a8a561
rm -f l10n-${lver}.tar.xz
a8a561
tar caf l10n-lightning-${tbver}.tar.xz --exclude='.hg*'  l10n-merged