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