summaryrefslogtreecommitdiffstats
path: root/release/koffice-l10n
blob: 3e39180c1f427a44005bf07ed67eb50f75082e0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/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