1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 04_fix_locale_location.dpatch by <cajus@debian.org>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Fixed location of auto-generated locales
7 @DPATCH@
8 diff -urNad gosa-2.6.0+svn11288~/include/php_setup.inc gosa-2.6.0+svn11288/include/php_setup.inc
9 --- gosa-2.6.0+svn11288~/include/php_setup.inc 2008-06-11 15:55:59.000000000 +0200
10 +++ gosa-2.6.0+svn11288/include/php_setup.inc 2008-06-11 15:56:00.000000000 +0200
11 @@ -20,7 +20,7 @@
12 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
13 */
15 -define ("LOCALE_DIR", dirname(dirname(__FILE__))."/locale/compiled");
16 +define ("LOCALE_DIR", "/var/cache/gosa/locale");
18 function gosaRaiseError($errno, $errstr, $errfile, $errline)
19 {
20 diff -urNad gosa-2.6.0+svn11288~/update-gosa gosa-2.6.0+svn11288/update-gosa
21 --- gosa-2.6.0+svn11288~/update-gosa 2008-06-11 15:55:59.000000000 +0200
22 +++ gosa-2.6.0+svn11288/update-gosa 2008-06-11 16:02:30.000000000 +0200
23 @@ -169,20 +169,20 @@
25 /* For each language, merge the target .mo to the compiled directory. */
26 foreach ($languages as $language => $po_files){
27 - if (!is_dir(LOCALE_DIR."/compiled/${language}/LC_MESSAGES")){
28 - if (!mkdir (LOCALE_DIR."/compiled/${language}/LC_MESSAGES", 0755, TRUE)){
29 - echo "Failed to create '".LOCALE_DIR."/compiled/${language}/LC_MESSAGES'- aborted";
30 + if (!is_dir("/var/cache/gosa/locale/${language}/LC_MESSAGES")){
31 + if (!mkdir ("/var/cache/gosa/locale/${language}/LC_MESSAGES", 0755, TRUE)){
32 + echo "Failed to create '/var/cache/gosa/locale/${language}/LC_MESSAGES'- aborted";
33 exit (3);
34 }
35 }
37 /* Cat all these po files into one single file */
38 - system ("(cd ".LOCALE_DIR." && msgcat --use-first ".implode(" ", $po_files)." > compiled/${language}/LC_MESSAGES/messages.po)", $val);
39 + system ("(cd ".LOCALE_DIR." && msgcat --use-first ".implode(" ", $po_files)." > /var/cache/gosa/locale/${language}/LC_MESSAGES/messages.po)", $val);
40 if ($val != 0){
41 echo "Merging of message files failed - aborted";
42 exit (4);
43 }
44 - system ("(cd ".LOCALE_DIR."/compiled/${language}/LC_MESSAGES && msgfmt -o messages.mo messages.po && rm messages.po)", $val);
45 + system ("(cd /var/cache/gosa/locale/${language}/LC_MESSAGES && msgfmt -o messages.mo messages.po && rm messages.po)", $val);
46 if ($val != 0){
47 echo "Compiling of message files failed - aborted";
48 exit (5);