You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
3.9 KiB
133 lines
3.9 KiB
#!/bin/sh
|
|
# koffice-l10n - Creates a copy of branches/stable/l10n that contains
|
|
# only the koffice l10n files. Useful for tagging
|
|
# koffice-l10n without checkout out entire KDE l10n.
|
|
#
|
|
# Set ALT_LANGS to a space-delimited list of language
|
|
# codes for languages for which trunk/l10n should be used.
|
|
#
|
|
# Usage (tagging):
|
|
# Firstly:
|
|
# echo koffice-l10n > modules
|
|
# Update DESTURL in the `versions' file
|
|
# Update version numbers in `common' file
|
|
# Run this (setting ALT_LANGS first if necessary): ./koffice-l10n
|
|
# cd clean/tags-koffice/*/koffice-l10n && sh $OLDPWD/select-l10n
|
|
# mv language_list.new subdirs
|
|
# (Apply any changes requested by translators)
|
|
|
|
# Then (two commit version):
|
|
# Commit in clean/tags-koffice
|
|
# mv clean/tags-koffice/*/koffice-l10n clean
|
|
# cd clean && DO_SVN=1 ../removestuff koffice-l10n
|
|
# Commit in clean/koffice-l10n
|
|
|
|
# Or (hairy one commit version):
|
|
# sed -i 's/svn rm/svn rm --force/' removestuff
|
|
# mv clean/tags-koffice/*/koffice-l10n* clean/koffice-l10n
|
|
# cd clean && DO_SVN=1 ../removestuff koffice-l10n
|
|
# mv clean/koffice-l10n clean/tags-koffice/*/koffice-l10n*
|
|
# Commit in clean/tags-koffice
|
|
# mv clean/tags-koffice/*/koffice-l10n* clean/koffice-l10n
|
|
|
|
# Finally:
|
|
# From release/, ./pack koffice-l10n
|
|
# (Pack requires tdelibs, bzip2, automake and - to avoid stupid
|
|
# warnings - libtool :o) )
|
|
|
|
#SVNUSER=martin
|
|
#SVNPROTOCOL=https
|
|
#ALT_LANGS=""
|
|
KOFFICE_L10N=branches/stable/l10n
|
|
KOFFICE_L10N_ALT=trunk/l10n
|
|
|
|
test -n "$SVNUSER" || { echo "You must set SVNUSER"; exit 1; }
|
|
test -n "$SVNPROTOCOL" || { echo "You must set SVNPROTOCOL"; exit 1; }
|
|
BASE=$SVNPROTOCOL://$SVNUSER@svn.kde.org/home/kde
|
|
#BASE=svn://anonsvn.kde.org/home/kde
|
|
|
|
set -e
|
|
|
|
# Get the version number from the versions script
|
|
. versions
|
|
set_urls koffice-l10n
|
|
VERSION=`echo $DESTURL|sed 's#^tags/koffice/\(.*\)/koffice-l10n#\1#'`
|
|
|
|
# Check the version number is sane
|
|
if test 0 -ne `(echo "$VERSION" | grep -c "[^0-9\.]") || true` ; then
|
|
echo "Didn't understand koffice-l10n version number: $VERSION"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Preparing checkout for koffice-l10n-$VERSION"
|
|
|
|
# Create the checkout dir if it doesn't exist
|
|
if test ! -d clean ; then
|
|
mkdir clean
|
|
fi
|
|
|
|
STARTDATE=`date -R`
|
|
(
|
|
echo "Started tagging at $STARTDATE"
|
|
|
|
cd clean
|
|
echo "Creating a work directory..."
|
|
svn co -N $BASE/tags/koffice tags-koffice
|
|
cd tags-koffice
|
|
REV=`svnversion`
|
|
svn up -N $VERSION
|
|
if test ! -d $VERSION ; then
|
|
svn mkdir $VERSION
|
|
fi
|
|
svn mkdir $VERSION/koffice-l10n
|
|
cd $VERSION/koffice-l10n
|
|
|
|
# Copy the top level l10n files ...
|
|
L10N=$BASE/$KOFFICE_L10N
|
|
L10N_ALT=$BASE/$KOFFICE_L10N_ALT
|
|
|
|
echo "Copying top level l10n files from $KOFFICE_L10N."
|
|
for d in COPYING INSTALL README subdirs teamnames ; do
|
|
svn cp -r $REV $L10N/$d .
|
|
done
|
|
|
|
echo "Copying the l10n scripts"
|
|
svn cp -r $REV $L10N/scripts .
|
|
|
|
echo "Replacing l10n external admin dir with a copy"
|
|
svn propget svn:externals scripts | while read subdir url; do
|
|
test -n "$url" || continue
|
|
rm -rf scripts/$subdir
|
|
svn copy ${url/https:\/\//$SVNPROTOCOL://$SVNUSER@} scripts/$subdir
|
|
done
|
|
svn propdel svn:externals scripts
|
|
|
|
echo "Copying the language packs"
|
|
for lang in `cat subdirs` ; do
|
|
|
|
# Should we grab the language pack from the alternative location?
|
|
use_alt_loc=`(echo "$ALT_LANGS" | grep -wc "$lang") || true`
|
|
if test $use_alt_loc -eq 0 ; then
|
|
URL=$L10N
|
|
else
|
|
URL=$L10N_ALT
|
|
fi
|
|
|
|
echo "Copying language files for $lang from $URL"
|
|
svn mkdir $lang
|
|
for sub in data docs messages ; do
|
|
# According to the removestuff script, anything except Makefile.am
|
|
# and the koffice dir are deleted anyway, so lets just get them.
|
|
svn mkdir $lang/$sub
|
|
svn cp -r $REV $URL/$lang/$sub/koffice $lang/$sub || true
|
|
if [ "$sub" = data ] ; then
|
|
svn cp -r $REV $URL/$lang/$sub/Makefile.am $lang/$sub || true
|
|
fi
|
|
done
|
|
done
|
|
|
|
FINISHDATE=`date -R`
|
|
echo "Finished tagging at $FINISHDATE"
|
|
|
|
) | tee koffice-l10n-`date --date "$STARTDATE" +%Y%m%d%-k%M%S`.log
|