Code

74f9e366245a6578f2f5428d54784c2200d868cd
[gosa.git] / gosa-core / debian / patches / 04_fix_locale_location.patch
1 Author: <cajus@debian.org>
2 Description: Fixed location of auto-generated locales
3 --- a/include/php_setup.inc
4 +++ b/include/php_setup.inc
5 @@ -20,7 +20,7 @@
6   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
7   */
8  
9 -define ("LOCALE_DIR", dirname(dirname(__FILE__))."/locale/compiled");
10 +define ("LOCALE_DIR", "/var/cache/gosa/locale");
11  
12  function gosaRaiseError($errno, $errstr, $errfile, $errline)
13  {
14 --- a/update-gosa
15 +++ b/update-gosa
16 @@ -185,20 +185,20 @@
17  
18         /* For each language, merge the target .mo to the compiled directory. */
19         foreach ($languages as $language => $po_files){
20 -               if (!is_dir(LOCALE_DIR."/compiled/${language}/LC_MESSAGES")){
21 -                       if (!mkdir (LOCALE_DIR."/compiled/${language}/LC_MESSAGES", 0755, TRUE)){
22 -                               echo "Failed to create '".LOCALE_DIR."/compiled/${language}/LC_MESSAGES'- aborted";
23 +               if (!is_dir("/var/cache/gosa/locale/${language}/LC_MESSAGES")){
24 +                       if (!mkdir ("/var/cache/gosa/locale/${language}/LC_MESSAGES", 0755, TRUE)){
25 +                               echo "Failed to create '/var/cache/gosa/locale/${language}/LC_MESSAGES'- aborted";
26                                 exit (3);
27                         }
28                 }
29  
30                 /* Cat all these po files into one single file */
31 -               system ("(cd ".LOCALE_DIR." && msgcat --use-first ".implode(" ", $po_files)." > compiled/${language}/LC_MESSAGES/messages.po)", $val);
32 +               system ("(cd ".LOCALE_DIR." && msgcat --use-first ".implode(" ", $po_files)." > /var/cache/gosa/locale/${language}/LC_MESSAGES/messages.po)", $val);
33                 if ($val != 0){
34                         echo "Merging of message files failed - aborted";
35                         exit (4);
36                 }
37 -               system ("(cd ".LOCALE_DIR."/compiled/${language}/LC_MESSAGES && msgfmt -o messages.mo messages.po && rm messages.po)", $val);
38 +               system ("(cd /var/cache/gosa/locale/${language}/LC_MESSAGES && msgfmt -o messages.mo messages.po && rm messages.po)", $val);
39                 if ($val != 0){
40                         echo "Compiling of message files failed - aborted";
41                         exit (5);