5 |
|
|
6 |
# Clean up tmp dir |
# Clean up tmp dir |
7 |
rm -rf /var/lib/pootle/tmp |
rm -rf /var/lib/pootle/tmp |
8 |
mkdir -p /var/lib/pootle/tmp/ /var/www/html/pootle/{patches,errors,anaconda} |
mkdir -p /var/lib/pootle/tmp/ /var/www/html/{patches,errors,anaconda} |
9 |
|
|
10 |
#========================================================== |
#========================================================== |
|
# to help debugging set to 1 and it will help to follow where errors occurs |
|
|
debug=0 |
|
11 |
|
|
12 |
export CVS_RSH=ssh |
export CVS_RSH=ssh |
13 |
|
|
|
(($debug)) && builtin echo "Update/expand smeserver cvs" |
|
14 |
# Update/expand smeserver cvs |
# Update/expand smeserver cvs |
15 |
cd /var/lib/pootle/cvs/smeserver |
cd /var/lib/pootle/cvs/smeserver |
16 |
for pkg in *e-smith*/sme* *sme*/sme* anaconda/sme* booty/sme* |
for pkg in *e-smith*/sme* *sme*/sme* anaconda/sme* booty/sme* |
23 |
make -C $pkg prep &> /dev/null |
make -C $pkg prep &> /dev/null |
24 |
done |
done |
25 |
|
|
|
(($debug)) && builtin echo "Update/expand smecontribs cvs" |
|
26 |
# Update/expand smecontribs cvs |
# Update/expand smecontribs cvs |
27 |
cd /var/lib/pootle/cvs/smecontribs |
cd /var/lib/pootle/cvs/smecontribs |
28 |
for pkg in *e-smith*/contribs* *sme*/contribs* |
for pkg in *e-smith*/contribs* *sme*/contribs* |
42 |
# Sync database stores to filesystem |
# Sync database stores to filesystem |
43 |
django-admin sync_stores --settings=pootle.settings &> /dev/null |
django-admin sync_stores --settings=pootle.settings &> /dev/null |
44 |
|
|
45 |
for ver in sme8 sme9 sme10 |
for ver in sme7 sme8 |
46 |
do |
do |
|
(($debug)) && echo&& echo builtin echo "anaconda $ver" # debug jpp |
|
47 |
# Update anaconda template |
# Update anaconda template |
48 |
anacondatmpl $ver > anaconda.pot |
anacondatmpl $ver > anaconda.pot |
49 |
diffmv anaconda.pot /var/lib/pootle/po/$ver/templates/anaconda.pot |
diffmv anaconda.pot /var/lib/pootle/po/$ver/templates/anaconda.pot |
50 |
|
|
|
(($debug)) && echo&& echo builtin echo "console template $ver " |
|
51 |
# Update console templates |
# Update console templates |
52 |
potempl $(find /var/lib/pootle/cvs/smeserver/e-smith-quota/$ver/ -type f -name adminQuotaSummary.tmpl) > adminQuotaSummary.tmpl.pot |
potempl $(find /var/lib/pootle/cvs/smeserver/e-smith-quota/$ver/ -type f -name adminQuotaSummary.tmpl) > adminQuotaSummary.tmpl.pot |
53 |
diffmv adminQuotaSummary.tmpl.pot /var/lib/pootle/po/$ver/templates/adminQuotaSummary.tmpl.pot |
diffmv adminQuotaSummary.tmpl.pot /var/lib/pootle/po/$ver/templates/adminQuotaSummary.tmpl.pot |
60 |
potempl $(find /var/lib/pootle/cvs/smeserver/e-smith-quota/$ver/ -type f -name userOverQuota.tmpl) > userOverQuota.tmpl.pot |
potempl $(find /var/lib/pootle/cvs/smeserver/e-smith-quota/$ver/ -type f -name userOverQuota.tmpl) > userOverQuota.tmpl.pot |
61 |
diffmv userOverQuota.tmpl.pot /var/lib/pootle/po/$ver/templates/userOverQuota.tmpl.pot |
diffmv userOverQuota.tmpl.pot /var/lib/pootle/po/$ver/templates/userOverQuota.tmpl.pot |
62 |
|
|
|
(($debug)) && echo&& echo builtin echo "panel template $ver " |
|
63 |
# Update panel templates |
# Update panel templates |
64 |
for pkg in $(find /var/lib/pootle/cvs/smeserver/*/$ver/*/root/etc/e-smith/locale/en-us/ -type f -not -regex '.*\+ldap/.*' 2> /dev/null) |
for pkg in $(find /var/lib/pootle/cvs/smeserver/*/$ver/*/root/etc/e-smith/locale/en-us/ -type f -not -regex '.*\+ldap/.*' 2> /dev/null) |
65 |
do |
do |
68 |
done |
done |
69 |
done |
done |
70 |
|
|
71 |
for ver in contribs8 contribs9 |
for ver in contribs7 contribs8 |
72 |
do |
do |
73 |
nver=$(echo $ver| tr -dc '0-9') |
if [ "$ver" == "contribs7" ] |
|
if [ "$nver" -ge "9" ] |
|
74 |
then |
then |
75 |
(($debug)) && echo&& echo builtin echo "sme*admin template $ver " |
# Update sme7admin template |
76 |
# Update sme*admin template |
potempl /var/lib/pootle/cvs/smecontribs/smeserver-sme7admin/$ver/*/root/{etc/e-smith/web/functions/sme7admin,usr/bin/sme7admind} > sme7admin.pot |
77 |
#echo "smeserver-sme${nver}admin" |
diffmv sme7admin.pot /var/lib/pootle/po/$ver/templates/sme7admin.pot |
|
potempl /var/lib/pootle/cvs/smecontribs/smeserver-sme${nver}admin/$ver/*/root/{etc/e-smith/web/functions/sme${nver}admin,usr/bin/sme${nver}admind} > sme${nver}admin.pot |
|
|
diffmv sme${nver}admin.pot /var/lib/pootle/po/$ver/templates/sme${nver}admin.pot |
|
78 |
fi |
fi |
79 |
|
|
|
(($debug)) && echo&& echo builtin echo "contribs others template $ver" |
|
80 |
# Update contrib panel templates |
# Update contrib panel templates |
81 |
for pkg in $(find /var/lib/pootle/cvs/smecontribs/*/$ver/*/root/etc/e-smith/locale/en-us/ -type f 2> /dev/null) |
for pkg in $(find /var/lib/pootle/cvs/smecontribs/*/$ver/*/root/etc/e-smith/locale/en-us/ -type f 2> /dev/null) |
82 |
do |
do |
91 |
rsync -amR --include '*/' --include '*.po' --exclude '*' /var/lib/pootle/po/./{sme,contribs}[0-9]/ /var/lib/pootle/tmp/errors/ |
rsync -amR --include '*/' --include '*.po' --exclude '*' /var/lib/pootle/po/./{sme,contribs}[0-9]/ /var/lib/pootle/tmp/errors/ |
92 |
find /var/lib/pootle/tmp/errors/ -type f -exec sed -i '/^#~/d' {} \+ |
find /var/lib/pootle/tmp/errors/ -type f -exec sed -i '/^#~/d' {} \+ |
93 |
|
|
|
(($debug)) && echo&& echo builtin echo "Apply templates to languages" |
|
94 |
# Apply templates to languages |
# Apply templates to languages |
95 |
for lang in $(ls -I templates /var/lib/pootle/po/{sme,contribs}[0-9] 2> /dev/null | grep '[[:alpha:]]$' | sort -u) |
for lang in $(ls -I templates /var/lib/pootle/po/{sme,contribs}[0-9] 2> /dev/null | grep '[[:alpha:]]$' | sort -u) |
96 |
do |
do |
123 |
done |
done |
124 |
done |
done |
125 |
|
|
|
(($debug)) && echo&& echo builtin echo "Copy po files so we can create error reports" |
|
126 |
# Copy po files so we can create error reports |
# Copy po files so we can create error reports |
127 |
rsync -amR --include '*/' --include '*.po' --exclude '*' /var/lib/pootle/po/./{sme,contribs}[0-9]/ /var/lib/pootle/tmp/errors/ |
rsync -amR --include '*/' --include '*.po' --exclude '*' /var/lib/pootle/po/./{sme,contribs}[0-9]/ /var/lib/pootle/tmp/errors/ |
128 |
|
|
129 |
#========================================================== |
#========================================================== |
130 |
|
|
|
(($debug)) && echo&& echo builtin echo "Sync filesystem to database stores" |
|
131 |
# Sync filesystem to database stores |
# Sync filesystem to database stores |
132 |
django-admin update_stores --settings=pootle.settings &> /dev/null |
django-admin update_stores --settings=pootle.settings &> /dev/null |
133 |
|
|
|
(($debug)) && echo&& echo builtin echo "Recalculate stats and restart server" |
|
134 |
# Recalculate stats and restart server |
# Recalculate stats and restart server |
135 |
django-admin refresh_stats --settings=pootle.settings &> /dev/null |
django-admin refresh_stats --settings=pootle.settings &> /dev/null |
136 |
|
|
137 |
#========================================================== |
#========================================================== |
138 |
|
|
|
(($debug)) && echo&& echo builtin echo "Create error compendium to assist translators" |
|
139 |
# Create error compendium to assist translators |
# Create error compendium to assist translators |
140 |
find /var/lib/pootle/tmp/errors/ -type f -exec sed -i '/^#~/d' {} \+ |
find /var/lib/pootle/tmp/errors/ -type f -exec sed -i '/^#~/d' {} \+ |
141 |
for lang in $(ls -I templates /var/lib/pootle/po/{sme,contribs}[0-9] 2> /dev/null | grep '[[:alpha:]]$' | sort -u) |
for lang in $(ls -I templates /var/lib/pootle/po/{sme,contribs}[0-9] 2> /dev/null | grep '[[:alpha:]]$' | sort -u) |
146 |
| sed ':a;/^\n*$/{$d;N;ba;}' \ |
| sed ':a;/^\n*$/{$d;N;ba;}' \ |
147 |
> errors-$lang.err |
> errors-$lang.err |
148 |
chmod 644 errors-$lang.err |
chmod 644 errors-$lang.err |
149 |
diffmv errors-$lang.err /var/www/html/pootle/errors/errors-$lang.err |
diffmv errors-$lang.err /var/www/html/errors/errors-$lang.err |
150 |
done |
done |
151 |
|
|
|
(($debug)) && echo&& echo builtin echo "Build diffs for languages" |
|
152 |
# Build diffs for languages |
# Build diffs for languages |
153 |
for pkg in $(ls /var/lib/pootle/po/{sme,contribs}[0-9]/templates/ | sed -n 's@\.pot@@p' | sort -u) |
for pkg in $(ls /var/lib/pootle/po/{sme,contribs}[0-9]/templates/ | sed -n 's@\.pot@@p' | sort -u) |
154 |
do |
do |
159 |
then |
then |
160 |
ls /var/lib/pootle/po/*/*/$pkg.po | cut -d/ --output-delimiter " " -f6,7 | while read ver lang |
ls /var/lib/pootle/po/*/*/$pkg.po | cut -d/ --output-delimiter " " -f6,7 | while read ver lang |
161 |
do |
do |
162 |
[[ $ver == *7 ]] && continue |
mkdir -p /var/www/html/anaconda/$ver/$lang/LC_MESSAGES |
163 |
|
anacondagen $ver $lang > /var/www/html/anaconda/$ver/$lang/LC_MESSAGES/anaconda.mo |
164 |
(($debug)) && echo&& echo builtin echo "anaconda $ver $lang " |
[ -s /var/www/html/anaconda/$ver/$lang/LC_MESSAGES/anaconda.mo ] || rm -rf /var/www/html/anaconda/$ver/$lang |
|
mkdir -p /var/www/html/pootle/anaconda/$ver/$lang/LC_MESSAGES |
|
|
anacondagen $ver $lang > /var/www/html/pootle/anaconda/$ver/$lang/LC_MESSAGES/anaconda.mo |
|
|
[ -s /var/www/html/pootle/anaconda/$ver/$lang/LC_MESSAGES/anaconda.mo ] || rm -rf /var/www/html/pootle/anaconda/$ver/$lang |
|
165 |
done |
done |
166 |
else |
else |
167 |
pkgs=$(ls -d /var/lib/pootle/cvs/*/smeserver-$pkg/*/*/root 2> /dev/null) |
pkgs=$(ls -d /var/lib/pootle/cvs/*/smeserver-$pkg/*/*/root 2> /dev/null) |
169 |
|
|
170 |
echo "$pkgs" | cut -d/ --output-delimiter " " -f8,9 | while read ver pkgname |
echo "$pkgs" | cut -d/ --output-delimiter " " -f8,9 | while read ver pkgname |
171 |
do |
do |
|
[[ $ver == *7 ]] && continue |
|
|
|
|
|
(($debug)) && echo&& echo builtin echo "$pkg $ver" |
|
172 |
for lang in $(ls -I templates /var/lib/pootle/po/$ver/ 2> /dev/null | grep '[[:alpha:]]$' | sort -u) |
for lang in $(ls -I templates /var/lib/pootle/po/$ver/ 2> /dev/null | grep '[[:alpha:]]$' | sort -u) |
173 |
do |
do |
|
(($debug)) && echo&& echo builtin echo "* $pkg $lang " |
|
174 |
if [ -f "/var/lib/pootle/po/$ver/$lang/${pkg}.po" ] |
if [ -f "/var/lib/pootle/po/$ver/$lang/${pkg}.po" ] |
175 |
then |
then |
176 |
mkdir -p diff/$ver/${pkgname}.update/po/$lang |
mkdir -p diff/$ver/${pkgname}.update/po/$lang |
186 |
echo "$pkgs" | grep -qv '/contribs[0-9]/' && pkgs=$(echo "$pkgs" | grep '/contribs[0-9]/'; ls -d /var/lib/pootle/cvs/*/smeserver-locale/*/*/root) |
echo "$pkgs" | grep -qv '/contribs[0-9]/' && pkgs=$(echo "$pkgs" | grep '/contribs[0-9]/'; ls -d /var/lib/pootle/cvs/*/smeserver-locale/*/*/root) |
187 |
echo "$pkgs" | cut -d/ --output-delimiter " " -f8,9 | while read ver pkgname |
echo "$pkgs" | cut -d/ --output-delimiter " " -f8,9 | while read ver pkgname |
188 |
do |
do |
189 |
[[ $ver == *7 ]] && continue |
if echo $ver | grep -q contribs |
|
|
|
|
if [[ $ver == contribs* ]] |
|
190 |
then |
then |
191 |
if [ -f /var/lib/pootle/templates/$ver/$pkg.orig ] |
mkdir -p diff/$ver/${pkgname}.update/$(localedir en-us $pkg) |
192 |
then |
cat /var/lib/pootle/templates/$ver/$pkg.orig \ |
193 |
(($debug)) && echo&& echo builtin echo "$pkg update $ver" |
| perl -pe 's@_AMP_@&@g;s@_{_@<@g;s@_}_@>@g' \ |
194 |
mkdir -p diff/$ver/${pkgname}.update/$(localedir en-us $pkg) |
> diff/$ver/${pkgname}.update/$(localedir en-us $pkg)/$pkg |
|
cat /var/lib/pootle/templates/$ver/$pkg.orig \ |
|
|
| perl -pe 's@_AMP_@&@g;s@_{_@<@g;s@_}_@>@g' \ |
|
|
> diff/$ver/${pkgname}.update/$(localedir en-us $pkg)/$pkg |
|
|
fi |
|
195 |
fi |
fi |
196 |
for lang in $(ls -I templates /var/lib/pootle/po/$ver/ 2> /dev/null | grep '[[:alpha:]]$' | sort -u) |
for lang in $(ls -I templates /var/lib/pootle/po/$ver/ 2> /dev/null | grep '[[:alpha:]]$' | sort -u) |
197 |
do |
do |
|
(($debug)) && echo&& echo builtin echo "* $pkg $lang " |
|
198 |
mkdir -p diff/$ver/${pkgname}.update/$(localedir $lang $pkg) |
mkdir -p diff/$ver/${pkgname}.update/$(localedir $lang $pkg) |
199 |
xmlgen $ver /var/lib/pootle/po/$ver/$lang/${pkg}.po \ |
xmlgen $ver /var/lib/pootle/po/$ver/$lang/${pkg}.po \ |
200 |
> diff/$ver/${pkgname}.update/$(localedir $lang $pkg)/$pkg |
> diff/$ver/${pkgname}.update/$(localedir $lang $pkg)/$pkg |
203 |
fi |
fi |
204 |
done |
done |
205 |
|
|
|
(($debug)) && echo&& echo builtin echo "Build patches" |
|
206 |
# Build diffs |
# Build diffs |
207 |
ls -d diff/*/* | sed 's@.update$@@' | cut -d/ --output-delimiter " " -f2,3 | while read ver pkg |
ls -d diff/*/* | sed 's@.update$@@' | cut -d/ --output-delimiter " " -f2,3 | while read ver pkg |
208 |
do |
do |
209 |
mkdir -p /var/www/html/pootle/patches/$ver |
mkdir -p /var/www/html/patches/$ver |
210 |
rm -f /var/www/html/pootle/patches/$ver/$(echo $pkg | sed 's/-[^-]\+$//')-*-locale-*.patch |
rm -f /var/www/html/patches/$ver/$(echo $pkg | sed 's/-[^-]\+$//')-*-locale-*.patch |
211 |
if [ -d "diff/$ver/$pkg.update/root" ] |
if [ -d "diff/$ver/$pkg.update/root" ] |
212 |
then |
then |
213 |
diff -ruN {/var/lib/pootle/cvs/*/*/$ver/$pkg,diff/$ver/$pkg.update}/root/etc/e-smith/locale \ |
diff -ruN {/var/lib/pootle/cvs/*/*/$ver/$pkg,diff/$ver/$pkg.update}/root/etc/e-smith/locale \ |
214 |
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/root/.*\)@\1 \2@;/^diff -ruN/d' \ |
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/root/.*\)@\1 \2@;/^diff -ruN/d' \ |
215 |
>> /var/www/html/pootle/patches/$ver/$pkg-locale-$(date +%F).patch |
>> /var/www/html/patches/$ver/$pkg-locale-$(date +%F).patch |
216 |
fi |
fi |
217 |
if [ -d "diff/$ver/$pkg.update/po" ] |
if [ -d "diff/$ver/$pkg.update/po" ] |
218 |
then |
then |
219 |
diff -ruN {/var/lib/pootle/cvs/*/*/$ver/$pkg,diff/$ver/$pkg.update}/po \ |
diff -ruN {/var/lib/pootle/cvs/*/*/$ver/$pkg,diff/$ver/$pkg.update}/po \ |
220 |
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/po/.*\)@\1 \2@;/^diff -ruN/d' \ |
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/po/.*\)@\1 \2@;/^diff -ruN/d' \ |
221 |
>> /var/www/html/pootle/patches/$ver/$pkg-locale-$(date +%F).patch |
>> /var/www/html/patches/$ver/$pkg-locale-$(date +%F).patch |
222 |
fi |
fi |
223 |
done |
done |
224 |
|
|