root/alternc/trunk/install/dopo.sh

Revision 2330, 1.5 kB (checked in by anarcat, 3 months ago)

restart the proper apache in locale regeneration script

  • Property svn:executable set to *
Line 
1 #!/bin/sh
2
3 # AlternC Language file builder
4 # THIS SCRIPT MUST BE LAUNCHED EACH TIME A MODULE IS ADDED OR REMOVED FROM ALTERNC
5 # eg: alternc-procmailbuilder, alternc-mailman ...
6 # $id$
7 #
8 # This script build one "alternc.mo" file per language in /var/alternc/bureau/locales/
9 # Each alternc.mo file is build with msgfmt from a alternc.po file.
10 # Each alternc.po file is build from a serie of .po files located in
11 # /var/alternc/bureau/locales/<lang>/LC_MESSAGES/*.po
12 # main.txt is included before all others .po to construct a complete alternc.po file.
13
14 #  - Advantages :
15 #    * allow to add or remove standalone modules to an existing AlternC fluently
16 #    * only one textdomain is used in all the sources (no need to change it from module to module)
17 #  - Drawbacks :
18 #    * AlternC now requires gettext package to work properly
19 #    * .mo file must be compiled at each upgrade/install
20
21 dolangs() {
22     read A
23     while [ "$A" ]
24     do
25         B="$A/LC_MESSAGES"
26         cd $B
27         rm -f alternc alternc.mo
28
29         # SARGETAG : msgcat exists only for Sarge, not on Woody. Use po.pl on woody, remove it for sarge.
30         msgcat --use-first *.po >alternc
31         # /usr/share/alternc/install/po.pl
32
33         msgfmt alternc -o alternc.mo
34         read A
35     done
36 }
37
38 # Apply the function to each language
39 find /var/alternc/bureau/locales -maxdepth 1 -mindepth 1 -type d -name "*_*" | dolangs
40
41 # Relance les apache pour qu'ils vident leur cache GetText
42 if [ -x /usr/sbin/apache ]; then
43     invoke-rc.d apache restart
44     invoke-rc.d apache-ssl restart
45 fi
46 if [ -x /usr/sbin/apache2 ]; then
47     invoke-rc.d apache2 restart
48 fi
49
50 exit 0
Note: See TracBrowser for help on using the browser.