[Zope-Perl] does not support INSTANCE_HOME

Gisle Aas gisle@ActiveState.com
26 Oct 2000 18:37:20 -0700


Stephen Harrison <stephen@nipltd.com> writes:

> I have discovered that the Zope-Perl products do not support
> INSTANCE_HOME stype zope installations.  It assumes that the server is
> running in the same lication as the server base code when it creates
> @INC (by adding './lib/perl' to @INC, rather than
> `INSTANCE_HOME`/lib/perl).
> 
> So this means that Zope.pm is not found when (for instance) creating a
> perl method.
> 
> Is there any official location for reporting bugs with zope-perl, or
> should we just post them to the list?

This list the the best place to report bugs.

> If I get the time I might even be able to produces patches to fix this,
> but I thought I would mention it in the mean time.

This is a patch:

==== //depot/main/Apps/Bifrost/zoperl/lib/python/Products/PerlExternalMethod/__init__.py#2 (text) ====

@@ -111,8 +111,8 @@
         """Invoke a PerlExternalMethod"""
         f = self.function
         if not perl.defined(f):
-            perl.eval("""local @INC = ("./Extensions", @INC); require %s""" %
-                      (self.module,))
+            perl.eval("""local @INC = ("%s/Extensions", @INC); require %s""" %
+                      (INSTANCE_HOME, self.module))
         elif DevelopmentMode:
             perlmod_reload(self.module)
         args = (f,) + args
@@ -134,7 +134,8 @@
 
 def perlmod_reload(module):
     if not perl.defined("Zope::reload_ext"):
-        perl.eval("""local @INC = ("./lib/perl", @INC); require Zope;""")
+        perl.eval("""local @INC = ("%s/lib/perl", @INC); require Zope;""" %
+                  (INSTANCE_HOME,))
     perl.callm("Zope::reload_ext", module)
 
 

==== //depot/main/Apps/Bifrost/zoperl/lib/python/Products/PerlMethod/__init__.py#4 (text) ====

@@ -148,7 +148,8 @@
         if not root:
             root = self.perl_mangled_name()
         if not perl.defined("Zope::setup_compartment"):
-            perl.eval("""local(@INC) = ("./lib/perl", @INC); require Zope""")
+            perl.eval("""local(@INC) = ("%s/lib/perl", @INC); require Zope""" %
+                      (INSTANCE_HOME,))
         perl.call("Zope::setup_compartment", root)
         perl.safecall(root, mask, ("_recompile", self.id,
                                    self.func_code.perl_args(),

==== //depot/main/Apps/Bifrost/zoperl/lib/python/Products/ZDBI_DA/db.py#3 (text) ====

@@ -118,7 +118,8 @@
     def query(self,query_string, max_rows=9999999):
         import perl
         if not perl.defined("Zope::dbi_query"):
-            perl.eval("""local @INC = ("./lib/perl", @INC); require Zope;""")
+            perl.eval("""local @INC = ("%s/lib/perl", @INC); require Zope;""" %
+                      (INSTANCE_HOME,))
         return perl.call("Zope::dbi_query",
                          id(self), self.connection,
                          query_string, max_rows)


Regards,
Gisle