/[smeserver]/builds_bin/update_templates
ViewVC logotype

Diff of /builds_bin/update_templates

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.4 by slords, Fri Oct 3 21:33:16 2008 UTC Revision 1.10 by slords, Mon Oct 26 22:02:53 2009 UTC
# Line 13  export CVS_RSH=ssh Line 13  export CVS_RSH=ssh
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
# Line 44  killall PootleServer Line 44  killall PootleServer
44    
45  #==========================================================  #==========================================================
46    
47  # Update anaconda templates  # Update anaconda template
48  anacondatmpl > anaconda.pot  anacondatmpl > anaconda.pot
49  diffmv anaconda.pot /etc/pootle/po/sme7bc/templates/anaconda.pot  diffmv anaconda.pot /etc/pootle/po/sme7bc/templates/anaconda.pot
50    
# Line 67  do Line 67  do
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
# Line 79  done Line 83  done
83  # Apply templates to languages  # Apply templates to languages
84  for lang in $(ls -I templates /etc/pootle/po/sme* | grep '[[:alpha:]]$' | sort -u)  for lang in $(ls -I templates /etc/pootle/po/sme* | grep '[[:alpha:]]$' | sort -u)
85  do  do
     # Create error compendium to assist translators  
     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  
   
86      # Create compendium to assist translations      # Create compendium to assist translations
87      pocompendium -c /etc/pootle/tmp/compendium-$lang.po -d /etc/pootle/po/*/$lang      pocompendium -c /etc/pootle/tmp/compendium-$lang.po -d /etc/pootle/po/*/$lang
88    
# Line 115  do Line 112  do
112      diffmv $chk $(echo $chk | sed 's@/tmp/@/po/@')      diffmv $chk $(echo $chk | sed 's@/tmp/@/po/@')
113  done  done
114    
115    # Copy po files so we can create error reports
116    rsync -amR --include '*/' --include '*.po' --exclude '*' /etc/pootle/po/./sme*/ /etc/pootle/tmp/errors/
117    find /etc/pootle/tmp/errors/ -type f -exec sed -i '/^#~/d' {} \+
118    
119  #==========================================================  #==========================================================
120    
121  # Recalculate stats and restart server  # Recalculate stats and restart server
122  cd /etc/pootle  cd /etc/pootle
123  PootleServer --refreshstats &> /dev/null  PootleServer --refreshstats &> /dev/null
124  nohup PootleServer --servertype threaded >> /var/log/pootle.log 2>&1 &  nohup PootleServer --prefsfile /etc/pootle/pootle.prefs >> /var/log/pootle.log 2>&1 &
125    
126  #==========================================================  #==========================================================
127    
128  cd /etc/pootle/tmp  cd /etc/pootle/tmp
129    
130    # Create error compendium to assist translators
131    for lang in $(ls /etc/pootle/tmp/errors/sme* | grep '[[:alpha:]]$' | sort -u)
132    do
133        pocompendium -e errors-$lang.po -d /etc/pootle/tmp/errors/sme*/$lang
134        sed -i '0,/^$/d;/^#~/d' errors-$lang.po
135        sed -i ':a;/^\n*$/{$d;N;ba;}' errors-$lang.po
136        chmod 644 errors-$lang.po
137        diffmv errors-$lang.po /var/www/html/errors/errors-$lang.po
138    done
139    
140  # Build diffs for languages  # Build diffs for languages
141  for lang in $(ls /etc/pootle/po/sme7bp -I templates)  for lang in $(ls /etc/pootle/po/sme7bp -I templates)
142  do  do
# Line 141  do Line 152  do
152      # Build console files      # Build console files
153      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)
154      mkdir -p ${pkgname}.update/po/$lang      mkdir -p ${pkgname}.update/po/$lang
155      for pkg in $(ls /etc/pootle/po/sme7bc/templates/ | sed -n '/^anaconda.pot$/b;s@\.pot@\.po@p')      for pkg in $(ls /etc/pootle/po/sme7bc/templates/ -I anaconda.pot | sed -n 's@\.pot@\.po@p')
156      do      do
157          msgcat -F --no-wrap /etc/pootle/po/sme7bc/$lang/$pkg \          msgcat -F --no-wrap /etc/pootle/po/sme7bc/$lang/$pkg \
158          | 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' \
159          | sed '0,/msgid ""/{/^#/d};/^#,/d' \          | sed '0,/msgid ""/{/^#/d};/^#,/d' \
160          > ${pkgname}.update/po/$lang/$pkg          > ${pkgname}.update/po/$lang/$pkg
161      done      done
162    
163        # Build sme7admin file
164        pkgname=$(ls -d /etc/pootle/cvs/smecontribs/smeserver-sme7admin/*7/*/root | cut -d/ -f8)
165        mkdir -p ${pkgname}.update/po/$lang
166        msgcat -F --no-wrap /etc/pootle/po/sme7cp/$lang/sme7admin.po \
167        | grep -v 'Project-Id-Version\|Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language-Team\|X-Generator' \
168        | sed '0,/msgid ""/{/^#/d};/^#,/d' \
169        > ${pkgname}.update/po/$lang/sme7admin.po
170  done  done
171    
172  # Build translated xml files  # Build translated xml files
173  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')
174  do  do
175      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)
176      if [ -z "$pkgname" ]      if [ -z "$pkgname" ]
# Line 179  done Line 198  done
198  # Build xml diffs  # Build xml diffs
199  for pkg in $(ls -d *.update | sed 's@.update$@@')  for pkg in $(ls -d *.update | sed 's@.update$@@')
200  do  do
     orig=/etc/pootle/cvs/sme*/*/*7/$pkg/root/etc/e-smith/locale  
201      rm -f /var/www/html/patches/$(echo $pkg | sed 's/-[^-]\+$//')-*-locale-*.patch      rm -f /var/www/html/patches/$(echo $pkg | sed 's/-[^-]\+$//')-*-locale-*.patch
202        [ -d $pkg.update/root/etc/e-smith/locale ] || continue
203        orig=/etc/pootle/cvs/sme*/*/*7/$pkg/root/etc/e-smith/locale
204      diff -ruN $orig $pkg.update/root/etc/e-smith/locale \      diff -ruN $orig $pkg.update/root/etc/e-smith/locale \
205      | sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/root/.*\)@\1 \2@;/^diff -ruN/d' \      | sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/root/.*\)@\1 \2@;/^diff -ruN/d' \
206      > /var/www/html/patches/$pkg-locale-$(date +%F).patch      > /var/www/html/patches/$pkg-locale-$(date +%F).patch
# Line 192  orig=/etc/pootle/cvs/smeserver/smeserver Line 212  orig=/etc/pootle/cvs/smeserver/smeserver
212  diff -ruN $orig $pkg.update/po \  diff -ruN $orig $pkg.update/po \
213  | sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/po/.*\)@\1 \2@;/^diff -ruN/d' \  | sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/po/.*\)@\1 \2@;/^diff -ruN/d' \
214  >> /var/www/html/patches/$pkg-locale-$(date +%F).patch  >> /var/www/html/patches/$pkg-locale-$(date +%F).patch
215    
216    # Build sme7admin diff
217    pkg=$(ls -d smeserver-sme7admin-* | sed 's@.update$@@')
218    orig=/etc/pootle/cvs/smecontribs/smeserver-sme7admin/*7/$pkg/po
219    diff -ruN $orig $pkg.update/po \
220    | sed 's@^\(---\|+++\) [^ ]\+/\([^/]\+/po/.*\)@\1 \2@;/^diff -ruN/d' \
221    >> /var/www/html/patches/$pkg-locale-$(date +%F).patch
222    


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed