1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
|
3 |
# Functions |
# Functions |
4 |
. /etc/pootle/bin/functions |
. /var/lib/pootle/bin/functions |
5 |
|
|
6 |
# Clean up tmp dir |
# Clean up tmp dir |
7 |
rm -rf /etc/pootle/tmp |
rm -rf /var/lib/pootle/tmp |
8 |
mkdir -p /etc/pootle/tmp /var/www/html/{patches,errors,anaconda} |
mkdir -p /var/lib/pootle/tmp/ /var/www/html/{patches,errors,anaconda} |
9 |
|
|
10 |
#========================================================== |
#========================================================== |
11 |
|
|
12 |
export CVS_RSH=ssh |
export CVS_RSH=ssh |
13 |
|
|
14 |
# Update/expand smeserver cvs |
# Update/expand smeserver cvs |
15 |
cd /etc/pootle/cvs/smeserver |
cd /var/lib/pootle/cvs/smeserver |
16 |
for pkg in */sme7 anaconda/sme8 |
for pkg in *e-smith*/sme* *sme*/sme* anaconda/sme* booty/sme* |
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 *e-smith*/sme* *sme*/sme* anaconda/sme* booty/sme* |
22 |
do |
do |
23 |
make -C $pkg prep &> /dev/null |
make -C $pkg prep &> /dev/null |
24 |
done |
done |
25 |
|
|
26 |
# Update/expand smecontribs cvs |
# Update/expand smecontribs cvs |
27 |
cd /etc/pootle/cvs/smecontribs |
cd /var/lib/pootle/cvs/smecontribs |
28 |
for pkg in */contribs7 |
for pkg in *e-smith*/contribs* *sme*/contribs* |
29 |
do |
do |
30 |
make -C $pkg clean &> /dev/null |
make -C $pkg clean &> /dev/null |
31 |
done |
done |
32 |
cvs update -dPA > /dev/null |
cvs update -dPA > /dev/null |
33 |
for pkg in */contribs7 |
for pkg in *e-smith*/contribs* *sme*/contribs* |
34 |
do |
do |
35 |
make -C $pkg prep &> /dev/null |
make -C $pkg prep &> /dev/null |
36 |
done |
done |
37 |
|
|
|
cd /etc/pootle/tmp |
|
|
|
|
38 |
#========================================================== |
#========================================================== |
39 |
|
|
40 |
# Take server down to prevent translation issues |
cd /var/lib/pootle/tmp |
|
killall PootleServer |
|
|
|
|
|
#========================================================== |
|
41 |
|
|
42 |
# Update anaconda templates |
# Sync database stores to filesystem |
43 |
anacondatmpl > anaconda.pot |
django-admin sync_stores --settings=pootle.settings &> /dev/null |
|
diffmv anaconda.pot /etc/pootle/po/sme7bc/templates/anaconda.pot |
|
|
|
|
|
# Update console templates |
|
|
potempl $(find /etc/pootle/cvs/smeserver/e-smith-quota/ -type f -name adminQuotaSummary.tmpl) > adminQuotaSummary.tmpl.pot |
|
|
diffmv adminQuotaSummary.tmpl.pot /etc/pootle/po/sme7bc/templates/adminQuotaSummary.tmpl.pot |
|
|
potempl $(find /etc/pootle/cvs/smeserver/e-smith-backup/ -type f -name do_backup -o -regex '.*/crontab/backup') > backup.pot |
|
|
diffmv backup.pot /etc/pootle/po/sme7bc/templates/backup.pot |
|
|
potempl $(find /etc/pootle/cvs/smeserver/e-smith-manager/ -type f -name 25Copyright) > foot.tmpl.pot |
|
|
diffmv foot.tmpl.pot /etc/pootle/po/sme7bc/templates/foot.tmpl.pot |
|
|
potempl $(find /etc/pootle/cvs/smeserver/ -type f -regex '.*/e-?smith/console.*') > server-console.pot |
|
|
diffmv server-console.pot /etc/pootle/po/sme7bc/templates/server-console.pot |
|
|
potempl $(find /etc/pootle/cvs/smeserver/e-smith-quota/ -type f -name userOverQuota.tmpl) > userOverQuota.tmpl.pot |
|
|
diffmv userOverQuota.tmpl.pot /etc/pootle/po/sme7bc/templates/userOverQuota.tmpl.pot |
|
44 |
|
|
45 |
# Update panel templates |
for ver in sme7 sme8 |
|
for pkg in $(find /etc/pootle/cvs/smeserver/*/*7/*/root/etc/e-smith/locale/en-us/ -type f -print) |
|
46 |
do |
do |
47 |
xmltempl $pkg "SME Panels" |
# Update anaconda template |
48 |
diffcp /etc/pootle/templates/$(basename $pkg).pot /etc/pootle/po/sme7bp/templates/$(basename $pkg).pot |
anacondatmpl $ver > anaconda.pot |
49 |
|
diffmv anaconda.pot /var/lib/pootle/po/$ver/templates/anaconda.pot |
50 |
|
|
51 |
|
# Update console templates |
52 |
|
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 |
54 |
|
potempl $(find /var/lib/pootle/cvs/smeserver/e-smith-backup/$ver/ -type f -name do_backup -o -regex '.*/crontab/backup') > backup-console.pot |
55 |
|
diffmv backup-console.pot /var/lib/pootle/po/$ver/templates/backup-console.pot |
56 |
|
potempl $(find /var/lib/pootle/cvs/smeserver/e-smith-manager/$ver/ -type f -name 25Copyright) > foot.tmpl.pot |
57 |
|
diffmv foot.tmpl.pot /var/lib/pootle/po/$ver/templates/foot.tmpl.pot |
58 |
|
potempl $(find /var/lib/pootle/cvs/smeserver/*/$ver/ -type f -regex '.*/e-?smith/console.*' -not -regex '.*\+ldap/.*') > server-console.pot |
59 |
|
diffmv server-console.pot /var/lib/pootle/po/$ver/templates/server-console.pot |
60 |
|
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 |
62 |
|
|
63 |
|
# 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) |
65 |
|
do |
66 |
|
xmltempl $ver $pkg |
67 |
|
diffcp /var/lib/pootle/templates/$ver/$(basename $pkg).pot /var/lib/pootle/po/$ver/templates/$(basename $pkg).pot |
68 |
|
done |
69 |
done |
done |
70 |
|
|
71 |
# Update contrib panel templates |
for ver in contribs7 contribs8 |
|
for pkg in $(find /etc/pootle/cvs/smecontribs/*/*7/*/root/etc/e-smith/locale/en-us/ -type f -print) |
|
72 |
do |
do |
73 |
xmltempl $pkg "Contrib Panels" |
if [ "$ver" == "contribs7" ] |
74 |
diffcp /etc/pootle/templates/$(basename $pkg).pot /etc/pootle/po/sme7cp/templates/$(basename $pkg).pot |
then |
75 |
|
# Update sme7admin template |
76 |
|
potempl /var/lib/pootle/cvs/smecontribs/smeserver-sme7admin/$ver/*/root/{etc/e-smith/web/functions/sme7admin,usr/bin/sme7admind} > sme7admin.pot |
77 |
|
diffmv sme7admin.pot /var/lib/pootle/po/$ver/templates/sme7admin.pot |
78 |
|
fi |
79 |
|
|
80 |
|
# 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) |
82 |
|
do |
83 |
|
xmltempl $ver $pkg |
84 |
|
diffcp /var/lib/pootle/templates/$ver/$(basename $pkg).pot /var/lib/pootle/po/$ver/templates/$(basename $pkg).pot |
85 |
|
done |
86 |
done |
done |
87 |
|
|
88 |
#========================================================== |
#========================================================== |
89 |
|
|
90 |
|
# Create copy of po files without obsolete strings |
91 |
|
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' {} \+ |
93 |
|
|
94 |
# Apply templates to languages |
# Apply templates to languages |
95 |
for lang in $(ls -I templates /etc/pootle/po/sme* | 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 |
|
# Create error compendium to assist translators |
|
|
pocompendium -e errors-$lang.po -d /etc/pootle/po/sme*/$lang |
|
|
sed -i '0,/^$/d' errors-$lang.po |
|
|
chmod 644 errors-$lang.po |
|
|
diffmv errors-$lang.po /var/www/html/errors/errors-$lang.po |
|
|
|
|
97 |
# Create compendium to assist translations |
# Create compendium to assist translations |
98 |
pocompendium -c /etc/pootle/tmp/compendium-$lang.po -d /etc/pootle/po/*/$lang |
msgcat --use-first <(msgcat $(find /var/lib/pootle/tmp/errors/*/$lang/ -name '*.po') | msgattrib --translated --no-fuzzy) \ |
99 |
|
<(msgcat --to-code UTF-8 $(find /var/lib/pootle/po/*/$lang/ -name '*.po') | msgattrib --translated --no-fuzzy) \ |
100 |
|
> /var/lib/pootle/tmp/compendium-$lang.po |
101 |
|
|
102 |
# Use compendium to migrate each project to new template |
# Use compendium to migrate each project to new template |
103 |
for proj in $(ls -d /etc/pootle/po/sme*/$lang | sed 's@.*/\([^/]\+\)/[^/]\+$@\1@') |
for ver in $(ls -d /var/lib/pootle/po/{sme,contribs}[0-9]/$lang 2> /dev/null | sed 's@.*/\([^/]\+\)/[^/]\+$@\1@') |
104 |
do |
do |
105 |
mkdir -p /etc/pootle/tmp/$proj/$lang |
mkdir -p /var/lib/pootle/tmp/$ver/$lang |
106 |
pomigrate2 -F -C=/etc/pootle/tmp/compendium-$lang.po -q --no-wrap --locale=$lang /etc/pootle/po/$proj/$lang /etc/pootle/tmp/$proj/$lang /etc/pootle/po/$proj/templates > /dev/null |
pomigrate2 -F -C=/var/lib/pootle/tmp/compendium-$lang.po -q --locale=$lang \ |
107 |
|
/var/lib/pootle/po/$ver/$lang /var/lib/pootle/tmp/$ver/$lang /var/lib/pootle/po/$ver/templates > /dev/null |
108 |
|
|
109 |
# Ensure language is correct |
# Ensure language is correct |
110 |
sed -i "/msgid \"en-us\"/{N;s@msgstr \"[^\"]*\"@msgstr \"$lang\"@}" /etc/pootle/tmp/$proj/$lang/* |
sed -i "/msgid \"en-us\"/{N;s@msgstr \"[^\"]*\"@msgstr \"$lang\"@}" /var/lib/pootle/tmp/$ver/$lang/* 2> /dev/null |
111 |
|
|
112 |
|
# Set package version in po files |
113 |
|
sed -i "s@\(Id-Version:\)[^\\]*@\1 SME $(echo $ver | sed 's@sme@Server @;s@contribs@Contribs @')@" /var/lib/pootle/tmp/$ver/$lang/*.po 2> /dev/null |
114 |
|
|
115 |
# Generate translation memory for panels |
# Generate translation memory for panels |
116 |
updatetm --progress none -c 4 -i /etc/pootle/tmp/$proj/$lang -t /etc/pootle/tmp/compendium-$lang.po -o /etc/pootle/tmp/$proj/$lang |
updatetm --progress none -c 4 -i /var/lib/pootle/tmp/$ver/$lang -t /var/lib/pootle/tmp/compendium-$lang.po -o /var/lib/pootle/tmp/$ver/$lang |
117 |
|
|
118 |
|
find /var/lib/pootle/tmp/$ver/$lang -type f | while read pkg |
119 |
|
do |
120 |
|
# Move files that have changed |
121 |
|
diffmv $pkg $(echo $pkg | sed 's@/tmp/@/po/@') |
122 |
|
done |
123 |
done |
done |
124 |
done |
done |
125 |
|
|
126 |
# Set package name/version in new po files |
# Copy po files so we can create error reports |
127 |
sed -i 's@Project-Id-Version.*\\n@Project-Id-Version: SME Console\\n@' /etc/pootle/tmp/sme7bc/*/*.po |
rsync -amR --include '*/' --include '*.po' --exclude '*' /var/lib/pootle/po/./{sme,contribs}[0-9]/ /var/lib/pootle/tmp/errors/ |
|
sed -i 's@Project-Id-Version.*\\n@Project-Id-Version: SME Anadonda\\n@' /etc/pootle/tmp/sme7bc/*/anaconda.po |
|
|
sed -i 's@Project-Id-Version.*\\n@Project-Id-Version: SME Panels\\n@' /etc/pootle/tmp/sme7bp/*/*.po |
|
|
sed -i 's@Project-Id-Version.*\\n@Project-Id-Version: Contrib Panels\\n@' /etc/pootle/tmp/sme7cp/*/*.po |
|
|
|
|
|
# Move files that have changed |
|
|
for chk in $(find /etc/pootle/tmp/sme* -type f) |
|
|
do |
|
|
diffmv $chk $(echo $chk | sed 's@/tmp/@/po/@') |
|
|
done |
|
128 |
|
|
129 |
#========================================================== |
#========================================================== |
130 |
|
|
131 |
|
# Sync filesystem to database stores |
132 |
|
django-admin update_stores --settings=pootle.settings &> /dev/null |
133 |
|
|
134 |
# Recalculate stats and restart server |
# Recalculate stats and restart server |
135 |
cd /etc/pootle |
django-admin refresh_stats --settings=pootle.settings &> /dev/null |
|
PootleServer --refreshstats &> /dev/null |
|
|
nohup PootleServer --servertype threaded >> /var/log/pootle.log 2>&1 & |
|
136 |
|
|
137 |
#========================================================== |
#========================================================== |
138 |
|
|
139 |
cd /etc/pootle/tmp |
# Create error compendium to assist translators |
140 |
|
find /var/lib/pootle/tmp/errors/ -type f -exec sed -i '/^#~/d' {} \+ |
141 |
# Build diffs for languages |
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 /etc/pootle/po/sme7bp -I templates) |
|
142 |
do |
do |
143 |
# Build anaconda files |
msgcat $(find /var/lib/pootle/tmp/errors/*/$lang/ -name '*.po') \ |
144 |
mkdir -p /var/www/html/anaconda/sme7/$lang/LC_MESSAGES |
| msgattrib --only-fuzzy \ |
145 |
anacondagen sme7 $lang > /var/www/html/anaconda/sme7/$lang/LC_MESSAGES/anaconda.mo |
| sed '0,/^$/d;/^#~/d' \ |
146 |
[ -s /var/www/html/anaconda/sme7/$lang/LC_MESSAGES/anaconda.mo ] || rm -rf /var/www/html/anaconda/sme7/$lang |
| sed ':a;/^\n*$/{$d;N;ba;}' \ |
147 |
|
> errors-$lang.po |
148 |
mkdir -p /var/www/html/anaconda/sme8/$lang/LC_MESSAGES |
chmod 644 errors-$lang.po |
149 |
anacondagen sme8 $lang > /var/www/html/anaconda/sme8/$lang/LC_MESSAGES/anaconda.mo |
diffmv errors-$lang.po /var/www/html/errors/errors-$lang.po |
|
[ -s /var/www/html/anaconda/sme8/$lang/LC_MESSAGES/anaconda.mo ] || rm -rf /var/www/html/anaconda/sme8/$lang |
|
|
|
|
|
# Build console files |
|
|
pkgname=$(ls -d /etc/pootle/cvs/smeserver/smeserver-locale/*7/*/root | cut -d/ -f8) |
|
|
mkdir -p ${pkgname}.update/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};/^#,/d' \ |
|
|
> ${pkgname}.update/po/$lang/$pkg |
|
|
done |
|
150 |
done |
done |
151 |
|
|
152 |
# Build translated xml files |
# Build diffs for languages |
153 |
for pkg in $(ls /etc/pootle/po/sme7*p/templates/ | sed -n 's@\.pot@@p') |
for pkg in $(ls /var/lib/pootle/po/{sme,contribs}[0-9]/templates/ | sed -n 's@\.pot@@p' | sort -u) |
154 |
do |
do |
155 |
pkgname=$(find /etc/pootle/cvs/smecontribs/*/*7/*/root/etc/e-smith/locale/en-us -name $pkg | cut -d/ -f8) |
pkgs=$(find /var/lib/pootle/cvs/*/*/*/*/root/etc/e-smith/locale/en-us -name $pkg -not -regex '.*\+ldap/.*') |
156 |
if [ -z "$pkgname" ] |
if [ -z "$pkgs" ] |
157 |
then |
then |
158 |
if [ -z "$(find /etc/pootle/cvs/smeserver/*/*7/*/root/etc/e-smith/locale/en-us -name $pkg)" ] |
if [ $pkg == "anaconda" ] |
159 |
then |
then |
160 |
echo -e "\n *** Can't find package for $pkg ***\n" |
ls /var/lib/pootle/po/*/*/$pkg.po | cut -d/ --output-delimiter " " -f6,7 | while read ver lang |
161 |
continue |
do |
162 |
fi |
mkdir -p /var/www/html/anaconda/$ver/$lang/LC_MESSAGES |
163 |
pkgname=$(ls -d /etc/pootle/cvs/smeserver/smeserver-locale/*7/*/root | cut -d/ -f8) |
anacondagen $ver $lang > /var/www/html/anaconda/$ver/$lang/LC_MESSAGES/anaconda.mo |
164 |
|
[ -s /var/www/html/anaconda/$ver/$lang/LC_MESSAGES/anaconda.mo ] || rm -rf /var/www/html/anaconda/$ver/$lang |
165 |
|
done |
166 |
|
else |
167 |
|
pkgs=$(ls -d /var/lib/pootle/cvs/*/smeserver-$pkg/*/*/root 2> /dev/null) |
168 |
|
[ -z "$pkgs" ] && pkgs=$(ls -d /var/lib/pootle/cvs/*/smeserver-locale/*/*/root) |
169 |
|
|
170 |
|
echo "$pkgs" | cut -d/ --output-delimiter " " -f8,9 | while read ver pkgname |
171 |
|
do |
172 |
|
for lang in $(ls -I templates /var/lib/pootle/po/$ver/ 2> /dev/null | grep '[[:alpha:]]$' | sort -u) |
173 |
|
do |
174 |
|
mkdir -p diff/$ver/${pkgname}.update/po/$lang |
175 |
|
msgcat -F --no-wrap /var/lib/pootle/po/$ver/$lang/${pkg}.po \ |
176 |
|
| grep -v 'Id-Version\|Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language-Team\|X-Generator' \ |
177 |
|
| sed '0,/msgid ""/{/^#/d};/^#,/d;s@^\(#: \)[^/]\+/root@\1root@' \ |
178 |
|
> diff/$ver/${pkgname}.update/po/$lang/${pkg/backup-console/backup}.po |
179 |
|
done |
180 |
|
done |
181 |
|
fi |
182 |
else |
else |
183 |
mkdir -p ${pkgname}.update/$(localedir en-us $pkg) |
echo "$pkgs" | grep -qv '/contribs[0-9]/' && pkgs=$(echo "$pkgs" | grep '/contribs[0-9]/'; ls -d /var/lib/pootle/cvs/*/smeserver-locale/*/*/root) |
184 |
cat /etc/pootle/templates/$pkg.orig \ |
echo "$pkgs" | cut -d/ --output-delimiter " " -f8,9 | while read ver pkgname |
185 |
| perl -pe 's@_AMP_@&@g;s@_{_@<@g;s@_}_@>@g' \ |
do |
186 |
> ${pkgname}.update/$(localedir en-us $pkg)/$pkg |
if echo $ver | grep -q contribs |
187 |
|
then |
188 |
|
mkdir -p diff/$ver/${pkgname}.update/$(localedir en-us $pkg) |
189 |
|
cat /var/lib/pootle/templates/$ver/$pkg.orig \ |
190 |
|
| perl -pe 's@_AMP_@&@g;s@_{_@<@g;s@_}_@>@g' \ |
191 |
|
> diff/$ver/${pkgname}.update/$(localedir en-us $pkg)/$pkg |
192 |
|
fi |
193 |
|
for lang in $(ls -I templates /var/lib/pootle/po/$ver/ 2> /dev/null | grep '[[:alpha:]]$' | sort -u) |
194 |
|
do |
195 |
|
mkdir -p diff/$ver/${pkgname}.update/$(localedir $lang $pkg) |
196 |
|
xmlgen $ver /var/lib/pootle/po/$ver/$lang/${pkg}.po \ |
197 |
|
> diff/$ver/${pkgname}.update/$(localedir $lang $pkg)/$pkg |
198 |
|
done |
199 |
|
done |
200 |
fi |
fi |
|
for lang in $(ls /etc/pootle/po/sme7bp -I templates) |
|
|
do |
|
|
mkdir -p ${pkgname}.update/$(localedir $lang $pkg) |
|
|
xmlgen /etc/pootle/po/sme7*p/$lang/${pkg}.po \ |
|
|
> ${pkgname}.update/$(localedir $lang $pkg)/$pkg |
|
|
done |
|
201 |
done |
done |
202 |
|
|
203 |
# Build xml diffs |
# Build diffs |
204 |
for pkg in $(ls -d *.update | sed 's@.update$@@') |
ls -d diff/*/* | sed 's@.update$@@' | cut -d/ --output-delimiter " " -f2,3 | while read ver pkg |
205 |
do |
do |
206 |
orig=/etc/pootle/cvs/sme*/*/*7/$pkg/root/etc/e-smith/locale |
mkdir -p /var/www/html/patches/$ver |
207 |
rm /var/www/html/patches/$(echo $pkg | sed 's/-[^-]\+$//')-*-locale-*.patch |
rm -f /var/www/html/patches/$ver/$(echo $pkg | sed 's/-[^-]\+$//')-*-locale-*.patch |
208 |
diff -ruN $orig $pkg.update/root/etc/e-smith/locale \ |
if [ -d "diff/$ver/$pkg.update/root" ] |
209 |
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/root/.*\)@\1 \2@;/^diff -ruN/d' \ |
then |
210 |
> /var/www/html/patches/$pkg-locale-$(date +%F).patch |
diff -ruN {/var/lib/pootle/cvs/*/*/$ver/$pkg,diff/$ver/$pkg.update}/root/etc/e-smith/locale \ |
211 |
|
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/root/.*\)@\1 \2@;/^diff -ruN/d' \ |
212 |
|
>> /var/www/html/patches/$ver/$pkg-locale-$(date +%F).patch |
213 |
|
fi |
214 |
|
if [ -d "diff/$ver/$pkg.update/po" ] |
215 |
|
then |
216 |
|
diff -ruN {/var/lib/pootle/cvs/*/*/$ver/$pkg,diff/$ver/$pkg.update}/po \ |
217 |
|
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/po/.*\)@\1 \2@;/^diff -ruN/d' \ |
218 |
|
>> /var/www/html/patches/$ver/$pkg-locale-$(date +%F).patch |
219 |
|
fi |
220 |
done |
done |
221 |
|
|
|
# Build console diffs |
|
|
pkg=$(ls -d smeserver-locale-* | sed 's@.update$@@') |
|
|
orig=/etc/pootle/cvs/smeserver/smeserver-locale/*7/$pkg/po |
|
|
rm /var/www/html/patches/$(echo $pkg | sed 's/-[^-]\+$//')-*-locale-*.patch |
|
|
diff -ruN $orig $pkg.update/po \ |
|
|
| sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/po/.*\)@\1 \2@;/^diff -ruN/d' \ |
|
|
>> /var/www/html/patches/$pkg-locale-$(date +%F).patch |
|
|
|
|
|
## cd /etc/pootle/tmp |
|
|
## |
|
|
## # Build diffs for languages |
|
|
## rm -f /var/www/html/patches/smeserver-locale-all-*.patch /var/www/html/patches/contribs/* |
|
|
## for lang in $(ls /etc/pootle/po/sme7bp -I templates) |
|
|
## do |
|
|
## # 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 |
|