File: 2003_fix-class-mapping.patch

package info (click to toggle)
gosa 2.8~git20230203.10abe45%2Bdfsg-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,108 kB
  • sloc: php: 32,102; javascript: 10,836; pascal: 3,776; xml: 3,135; sh: 852; python: 162; makefile: 45; perl: 2
file content (54 lines) | stat: -rw-r--r-- 1,888 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Author: Cajus Pollmeier <cajus@debian.org>
Description: Fix location of auto-generated class mapping file
Forwarded: not needed, Debian-specific

--- a/include/class_config.inc
+++ b/include/class_config.inc
@@ -116,12 +116,12 @@
            if we have installed or removed plugins. 
          */
         if(session::global_is_set("class_location.inc:timestamp")){
-            $tmp = stat("../include/class_location.inc");
+            $tmp = stat("/var/cache/gosa/class.cache");
             if($tmp['mtime'] != session::global_get("class_location.inc:timestamp")){
                 session::global_un_set("plist");
             }
         }
-        $tmp = stat("../include/class_location.inc");
+        $tmp = stat("/var/cache/gosa/class.cache");
         session::global_set("class_location.inc:timestamp",$tmp['mtime']);
 
         if($this->filename != "" && filemtime($this->filename) != $this->last_modified){
--- a/include/functions.inc
+++ b/include/functions.inc
@@ -77,7 +77,7 @@
 define('DES3_CBC_SHA1',16);
 
 /* Include required files */
-include_once("class_location.inc");
+require_once("/var/cache/gosa/class.cache");
 require_once ("functions_debug.inc");
 require_once ("accept-to-gettext.inc");
 
--- a/update-gosa
+++ b/update-gosa
@@ -21,7 +21,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-define ("GOSA_HOME", dirname(__FILE__));
+define ("GOSA_HOME", "/usr/share/gosa");
 define ("LOCALE_DIR", GOSA_HOME."/locale");
 define ("PLUGSTATE_DIR", GOSA_HOME."/state");
 
@@ -138,8 +138,8 @@
 function rescan_classes()
 {
 	echo "Updating class cache...\n";
-	$class_mapping= get_classes();
-	$filename= GOSA_HOME."/include/class_location.inc";
+	$class_mapping= get_classes("/usr/share/gosa");
+	$filename= "/var/cache/gosa/class.cache";
 
 	/* Sanity checks */
 	if (!file_exists($filename) || is_writable($filename)) {