Code

Updated class cache generation to work with the target location
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Feb 2008 10:52:43 +0000 (10:52 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Feb 2008 10:52:43 +0000 (10:52 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9165 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/debian/rules
gosa-core/update-gosa

index d9683996d51fba2da64cef36722d7e918f63a876..db79e19f3428e0ff2b4ffde992eeefa13b64e974 100755 (executable)
@@ -112,8 +112,9 @@ install-stamp:
        sed -i "s%require(\"smarty/Smarty.class.php\");%require(\"${SMARTY_LOCATION}/Smarty.class.php\");%g" debian/gosa/usr/share/gosa/include/php_setup.inc
 
        # Configure update location
-       sed -i 's%include/class_location.inc%/etc/gosa/classes%g' debian/gosa/usr/sbin/update-gosa
-       sed -i 's%$class_mapping= get_classes();%$class_mapping= get_classes("/usr/share/gosa");%g' debian/gosa/usr/sbin/update-gosa
+       sed -i 's%^define.*__FILE__.*%define ("GOSA_HOME", "/usr/share/gosa");%g' debian/gosa/usr/sbin/update-gosa
+       sed -i 's%GOSA_HOME.*include/class_location.inc%"/etc/gosa/classes%g' debian/gosa/usr/sbin/update-gosa
+       sed -i 's%class_mapping= get_classes();%class_mapping= get_classes("/usr/share/gosa");%g' debian/gosa/usr/sbin/update-gosa
        sed -i 's%class_location.inc%/etc/gosa/classes%g' debian/gosa/usr/share/gosa/include/functions.inc
 
        # Fix permissions
index 186947d5afd344da366bd9848bf60c923afd40c9..a4f418e1f05f3dd23e1dbb734bc1ab4445841bef 100755 (executable)
@@ -48,7 +48,11 @@ function get_classes($folder= ".")
   static $result= array();
 
   if ($base_dir == ""){
-    $base_dir= getcwd();
+    if ($folder == "."){
+      $base_dir= getcwd();
+    } else {
+      $base_dir= $folder;
+    }
   }
 
   $currdir=getcwd();