/[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.12 by slords, Tue Mar 2 22:08:55 2010 UTC Revision 1.17 by slords, Tue Nov 30 23:55:48 2010 UTC
# Line 39  done Line 39  done
39    
40  cd /var/lib/pootle/tmp  cd /var/lib/pootle/tmp
41    
42    # Sync database stores to filesystem
43    django-admin sync_stores --settings=pootle.settings &> /dev/null
44    
45  for ver in sme7 sme8  for ver in sme7 sme8
46  do  do
47      # Update anaconda template      # Update anaconda template
# Line 52  do Line 55  do
55      diffmv backup-console.pot /var/lib/pootle/po/$ver/templates/backup-console.pot      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      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      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.*') > server-console.pot      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      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      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
# Line 93  for lang in $(ls -I templates /var/lib/p Line 96  for lang in $(ls -I templates /var/lib/p
96  do  do
97      # Create compendium to assist translations      # Create compendium to assist translations
98      msgcat --use-first <(msgcat $(find /var/lib/pootle/tmp/errors/*/$lang/ -name '*.po') | msgattrib --translated --no-fuzzy) \      msgcat --use-first <(msgcat $(find /var/lib/pootle/tmp/errors/*/$lang/ -name '*.po') | msgattrib --translated --no-fuzzy) \
99                         <(msgcat $(find /var/lib/pootle/po/*/$lang/ -name '*.po') | msgattrib --translated --no-fuzzy) \                         <(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      > /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
# Line 106  do Line 109  do
109          # Ensure language is correct          # Ensure language is correct
110          sed -i "/msgid \"en-us\"/{N;s@msgstr \"[^\"]*\"@msgstr \"$lang\"@}" /var/lib/pootle/tmp/$ver/$lang/* 2> /dev/null          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 /var/lib/pootle/tmp/$ver/$lang -t /var/lib/pootle/tmp/compendium-$lang.po -o /var/lib/pootle/tmp/$ver/$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          find /var/lib/pootle/tmp/$ver/$lang -type f | while read pkg
119          do          do
             # Set package name/version in new po files  
             [ "${pkg%%.po}" != "$pkg" ] && sed -i "/Id-Version:/{s@\(Version:\)[^\\]*@\1 SME $ver ($(basename $pkg))@;s@sme@Server @;s@contribs@Contribs @;}" $pkg  
   
120              # Move files that have changed              # Move files that have changed
121              diffmv $pkg $(echo $pkg | sed 's@/tmp/@/po/@')              diffmv $pkg $(echo $pkg | sed 's@/tmp/@/po/@')
122          done          done
# Line 125  rsync -amR --include '*/' --include '*.p Line 128  rsync -amR --include '*/' --include '*.p
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  /usr/sbin/PootleServer --refreshstats &> /dev/null  django-admin refresh_stats --settings=pootle.settings &> /dev/null
136    
137  #==========================================================  #==========================================================
138    
# Line 138  do Line 144  do
144      | msgattrib --only-fuzzy \      | msgattrib --only-fuzzy \
145      | sed '0,/^$/d;/^#~/d' \      | sed '0,/^$/d;/^#~/d' \
146      | sed ':a;/^\n*$/{$d;N;ba;}' \      | sed ':a;/^\n*$/{$d;N;ba;}' \
147      > errors-$lang.po      > errors-$lang.err
148      chmod 644 errors-$lang.po      chmod 644 errors-$lang.err
149      diffmv errors-$lang.po /var/www/html/errors/errors-$lang.po      diffmv errors-$lang.err /var/www/html/errors/errors-$lang.err
150  done  done
151    
152  # Build diffs for languages  # Build diffs for languages
# Line 165  do Line 171  do
171              do              do
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
174                      mkdir -p diff/$ver/${pkgname}.update/po/$lang                      if [ -f "/var/lib/pootle/po/$ver/$lang/${pkg}.po" ]
175                      msgcat -F --no-wrap /var/lib/pootle/po/$ver/$lang/${pkg}.po \                      then
176                      | grep -v 'Id-Version\|Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language-Team\|X-Generator' \                          mkdir -p diff/$ver/${pkgname}.update/po/$lang
177                      | sed '0,/msgid ""/{/^#/d};/^#,/d;s@^\(#: \)[^/]\+/root@\1root@' \                          msgcat -F --no-wrap /var/lib/pootle/po/$ver/$lang/${pkg}.po \
178                      > diff/$ver/${pkgname}.update/po/$lang/${pkg/backup-console/backup}.po                          | grep -v 'Id-Version\|Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language-Team\|X-Generator' \
179                            | sed '0,/msgid ""/{/^#/d};/^#,/d;s@^\(#: \)[^/]\+/root@\1root@' \
180                            > diff/$ver/${pkgname}.update/po/$lang/${pkg/backup-console/backup}.po
181                        fi
182                  done                  done
183              done              done
184          fi          fi


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