13 |
|
|
14 |
# Update/expand smeserver cvs |
# Update/expand smeserver cvs |
15 |
cd /etc/pootle/cvs/smeserver |
cd /etc/pootle/cvs/smeserver |
16 |
for pkg in */sme7 anaconda/sme8 |
for pkg in */sme7 anaconda/sme8 booty/sme8 |
17 |
do |
do |
18 |
make -C $pkg clean &> /dev/null |
make -C $pkg clean &> /dev/null |
19 |
done |
done |
20 |
cvs update -dPA > /dev/null |
cvs update -dPA > /dev/null |
21 |
for pkg in */sme7 anaconda/sme8 |
for pkg in */sme7 anaconda/sme8 booty/sme8 |
22 |
do |
do |
23 |
make -C $pkg prep &> /dev/null |
make -C $pkg prep &> /dev/null |
24 |
done |
done |
67 |
diffcp /etc/pootle/templates/$(basename $pkg).pot /etc/pootle/po/sme7bp/templates/$(basename $pkg).pot |
diffcp /etc/pootle/templates/$(basename $pkg).pot /etc/pootle/po/sme7bp/templates/$(basename $pkg).pot |
68 |
done |
done |
69 |
|
|
70 |
|
# Update sme7admin template |
71 |
|
potempl /etc/pootle/cvs/smecontribs/smeserver-sme7admin/*/*/root/{etc/e-smith/web/functions/sme7admin,usr/bin/sme7admind} > sme7admin.pot |
72 |
|
diffmv sme7admin.pot /etc/pootle/po/sme7cp/templates/sme7admin.pot |
73 |
|
|
74 |
# Update contrib panel templates |
# Update contrib panel templates |
75 |
for pkg in $(find /etc/pootle/cvs/smecontribs/*/*7/*/root/etc/e-smith/locale/en-us/ -type f -print) |
for pkg in $(find /etc/pootle/cvs/smecontribs/*/*7/*/root/etc/e-smith/locale/en-us/ -type f -print) |
76 |
do |
do |
85 |
do |
do |
86 |
# Create error compendium to assist translators |
# Create error compendium to assist translators |
87 |
pocompendium -e errors-$lang.po -d /etc/pootle/po/sme*/$lang |
pocompendium -e errors-$lang.po -d /etc/pootle/po/sme*/$lang |
88 |
sed -i '0,/^$/d' errors-$lang.po |
sed -i '0,/^$/d;/^#~/d' errors-$lang.po |
89 |
|
sed -i ':a;/^\n*$/{$d;N;ba;}' errors-$lang.po |
90 |
chmod 644 errors-$lang.po |
chmod 644 errors-$lang.po |
91 |
diffmv errors-$lang.po /var/www/html/errors/errors-$lang.po |
diffmv errors-$lang.po /var/www/html/errors/errors-$lang.po |
92 |
|
|
124 |
# Recalculate stats and restart server |
# Recalculate stats and restart server |
125 |
cd /etc/pootle |
cd /etc/pootle |
126 |
PootleServer --refreshstats &> /dev/null |
PootleServer --refreshstats &> /dev/null |
127 |
nohup PootleServer --servertype threaded >> /var/log/pootle.log 2>&1 & |
nohup PootleServer --prefsfile /etc/pootle/pootle.prefs >> /var/log/pootle.log 2>&1 & |
128 |
|
|
129 |
#========================================================== |
#========================================================== |
130 |
|
|
145 |
# Build console files |
# Build console files |
146 |
pkgname=$(ls -d /etc/pootle/cvs/smeserver/smeserver-locale/*7/*/root | cut -d/ -f8) |
pkgname=$(ls -d /etc/pootle/cvs/smeserver/smeserver-locale/*7/*/root | cut -d/ -f8) |
147 |
mkdir -p ${pkgname}.update/po/$lang |
mkdir -p ${pkgname}.update/po/$lang |
148 |
for pkg in $(ls /etc/pootle/po/sme7bc/templates/ -I anaconda.pot | sed 's@\.pot@\.po@') |
for pkg in $(ls /etc/pootle/po/sme7bc/templates/ -I anaconda.pot | sed -n 's@\.pot@\.po@p') |
149 |
do |
do |
150 |
msgcat -F --no-wrap /etc/pootle/po/sme7bc/$lang/$pkg \ |
msgcat -F --no-wrap /etc/pootle/po/sme7bc/$lang/$pkg \ |
151 |
| grep -v 'Project-Id-Version\|Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language-Team\|X-Generator' \ |
| grep -v 'Project-Id-Version\|Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language-Team\|X-Generator' \ |
152 |
| sed '0,/msgid ""/{/^#/d};/^#,/d' \ |
| sed '0,/msgid ""/{/^#/d};/^#,/d' \ |
153 |
> ${pkgname}.update/po/$lang/$pkg |
> ${pkgname}.update/po/$lang/$pkg |
154 |
done |
done |
155 |
|
|
156 |
|
# Build sme7admin file |
157 |
|
pkgname=$(ls -d /etc/pootle/cvs/smecontribs/smeserver-sme7admin/*7/*/root | cut -d/ -f8) |
158 |
|
mkdir -p ${pkgname}.update/po/$lang |
159 |
|
msgcat -F --no-wrap /etc/pootle/po/sme7cp/$lang/sme7admin.po \ |
160 |
|
| grep -v 'Project-Id-Version\|Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language-Team\|X-Generator' \ |
161 |
|
| sed '0,/msgid ""/{/^#/d};/^#,/d' \ |
162 |
|
> ${pkgname}.update/po/$lang/sme7admin.po |
163 |
done |
done |
164 |
|
|
165 |
# Build translated xml files |
# Build translated xml files |
166 |
for pkg in $(ls /etc/pootle/po/sme7*p/templates/ | sed -n 's@\.pot@@p') |
for pkg in $(ls /etc/pootle/po/sme7*p/templates/ -I sme7admin.pot | sed -n 's@\.pot@@p') |
167 |
do |
do |
168 |
pkgname=$(find /etc/pootle/cvs/smecontribs/*/*7/*/root/etc/e-smith/locale/en-us -name $pkg | cut -d/ -f8) |
pkgname=$(find /etc/pootle/cvs/smecontribs/*/*7/*/root/etc/e-smith/locale/en-us -name $pkg | cut -d/ -f8) |
169 |
if [ -z "$pkgname" ] |
if [ -z "$pkgname" ] |
191 |
# Build xml diffs |
# Build xml diffs |
192 |
for pkg in $(ls -d *.update | sed 's@.update$@@') |
for pkg in $(ls -d *.update | sed 's@.update$@@') |
193 |
do |
do |
194 |
|
rm -f /var/www/html/patches/$(echo $pkg | sed 's/-[^-]\+$//')-*-locale-*.patch |
195 |
|
[ -d $pkg.update/root/etc/e-smith/locale ] || continue |
196 |
orig=/etc/pootle/cvs/sme*/*/*7/$pkg/root/etc/e-smith/locale |
orig=/etc/pootle/cvs/sme*/*/*7/$pkg/root/etc/e-smith/locale |
|
rm /var/www/html/patches/$(echo $pkg | sed 's/-[^-]\+$//')-*-locale-*.patch |
|
197 |
diff -ruN $orig $pkg.update/root/etc/e-smith/locale \ |
diff -ruN $orig $pkg.update/root/etc/e-smith/locale \ |
198 |
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/root/.*\)@\1 \2@;/^diff -ruN/d' \ |
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/root/.*\)@\1 \2@;/^diff -ruN/d' \ |
199 |
> /var/www/html/patches/$pkg-locale-$(date +%F).patch |
> /var/www/html/patches/$pkg-locale-$(date +%F).patch |
202 |
# Build console diffs |
# Build console diffs |
203 |
pkg=$(ls -d smeserver-locale-* | sed 's@.update$@@') |
pkg=$(ls -d smeserver-locale-* | sed 's@.update$@@') |
204 |
orig=/etc/pootle/cvs/smeserver/smeserver-locale/*7/$pkg/po |
orig=/etc/pootle/cvs/smeserver/smeserver-locale/*7/$pkg/po |
|
rm /var/www/html/patches/$(echo $pkg | sed 's/-[^-]\+$//')-*-locale-*.patch |
|
205 |
diff -ruN $orig $pkg.update/po \ |
diff -ruN $orig $pkg.update/po \ |
206 |
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/po/.*\)@\1 \2@;/^diff -ruN/d' \ |
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/po/.*\)@\1 \2@;/^diff -ruN/d' \ |
207 |
>> /var/www/html/patches/$pkg-locale-$(date +%F).patch |
>> /var/www/html/patches/$pkg-locale-$(date +%F).patch |
208 |
|
|
209 |
## cd /etc/pootle/tmp |
# Build sme7admin diff |
210 |
## |
pkg=$(ls -d smeserver-sme7admin-* | sed 's@.update$@@') |
211 |
## # Build diffs for languages |
orig=/etc/pootle/cvs/smecontribs/smeserver-sme7admin/*7/$pkg/po |
212 |
## rm -f /var/www/html/patches/smeserver-locale-all-*.patch /var/www/html/patches/contribs/* |
diff -ruN $orig $pkg.update/po \ |
213 |
## for lang in $(ls /etc/pootle/po/sme7bp -I templates) |
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/po/.*\)@\1 \2@;/^diff -ruN/d' \ |
214 |
## do |
>> /var/www/html/patches/$pkg-locale-$(date +%F).patch |
215 |
## # Remove previous patches |
|
|
## rm -f /var/www/html/patches/smeserver-locale-$lang-*.patch |
|
|
## |
|
|
## # Build anaconda files |
|
|
## mkdir -p /var/www/html/anaconda/sme7/$lang/LC_MESSAGES |
|
|
## anacondagen sme7 $lang > /var/www/html/anaconda/sme7/$lang/LC_MESSAGES/anaconda.mo |
|
|
## [ -s /var/www/html/anaconda/sme7/$lang/LC_MESSAGES/anaconda.mo ] || rm -rf /var/www/html/anaconda/sme7/$lang |
|
|
## |
|
|
## mkdir -p /var/www/html/anaconda/sme8/$lang/LC_MESSAGES |
|
|
## anacondagen sme8 $lang > /var/www/html/anaconda/sme8/$lang/LC_MESSAGES/anaconda.mo |
|
|
## [ -s /var/www/html/anaconda/sme8/$lang/LC_MESSAGES/anaconda.mo ] || rm -rf /var/www/html/anaconda/sme8/$lang |
|
|
## |
|
|
## # Build console diffs |
|
|
## mkdir -p pootleupdate/po/$lang |
|
|
## for pkg in $(ls /etc/pootle/po/sme7bc/templates/ -I anaconda.pot | sed 's@\.pot@\.po@') |
|
|
## do |
|
|
## msgcat -F --no-wrap /etc/pootle/po/sme7bc/$lang/$pkg \ |
|
|
## | grep -v 'Project-Id-Version\|Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language-Team\|X-Generator' \ |
|
|
## | sed '0,/msgid ""/{/^#/d}' \ |
|
|
## > pootleupdate/po/$lang/$pkg |
|
|
## if [ -f /etc/pootle/cvs/smeserver/smeserver-locale/*/*/po/$lang/$pkg ] |
|
|
## then |
|
|
## diff -u /etc/pootle/cvs/smeserver/smeserver-locale/*/*/po/$lang/$pkg pootleupdate/po/$lang/$pkg \ |
|
|
## | sed 's@/etc/pootle/cvs/smeserver/smeserver-locale/@@' \ |
|
|
## >> /var/www/html/patches/smeserver-locale-$lang-$(date +%F).patch |
|
|
## else |
|
|
## diff -u /dev/null pootleupdate/po/$lang/$pkg >> /var/www/html/patches/smeserver-locale-$lang-$(date +%F).patch |
|
|
## fi |
|
|
## done |
|
|
## |
|
|
## # Build panel diffs |
|
|
## mkdir -p pootleupdate/{$(localedir $lang general),$(localedir $lang userpassword),$(localedir $lang other)} |
|
|
## for pkg in $(ls /etc/pootle/po/sme7bp/templates/ | sed 's@\.pot@@') |
|
|
## do |
|
|
## match=$(find /etc/pootle/cvs/smeserver/ -type f -regex ".*/e-smith/locale/$lang/.*/$pkg") |
|
|
## xmlgen /etc/pootle/po/sme7bp/$lang/$pkg.po > pootleupdate/$(localedir $lang $pkg)/$pkg |
|
|
## diff -u ${match:-/dev/null} pootleupdate/$(localedir $lang $pkg)/$pkg \ |
|
|
## | sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/root/.*\)@\1 \2@' \ |
|
|
## >> /var/www/html/patches/smeserver-locale-$lang-$(date +%F).patch |
|
|
## done |
|
|
## |
|
|
## # Build contrib diffs |
|
|
## for pkg in $(ls /etc/pootle/po/sme7cp/templates/ | sed 's@\.pot@@') |
|
|
## do |
|
|
## match=$(find /etc/pootle/cvs/smecontribs/ -type f -regex ".*/e-smith/locale/$lang/.*/$pkg") |
|
|
## pkgname=$(find /etc/pootle/cvs/smecontribs/ -type f -regex ".*/e-smith/locale/en-us/.*/$pkg" | sed 's@.*/\([^/]\+\)/root/.*@\1@') |
|
|
## if [ ! -z "$pkgname" ] |
|
|
## then |
|
|
## xmlgen /etc/pootle/po/sme7cp/$lang/$pkg.po > pootleupdate/$(localedir $lang $pkg)/$pkg |
|
|
## diff -u ${match:-/dev/null} pootleupdate/$(localedir $lang $pkg)/$pkg \ |
|
|
## | sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/root/.*\)@\1 \2@' \ |
|
|
## >> /var/www/html/patches/contribs/$pkgname-locale-$(date +%F).patch |
|
|
## fi |
|
|
## done |
|
|
## done |
|
|
## cat /var/www/html/patches/smeserver-locale-*-$(date +%F).patch > /var/www/html/patches/smeserver-locale-all-$(date +%F).patch |
|