[Erp5-report] r34289 leonardo - /erp5/trunk/utils/erp5.recipe.standaloneinstance/src/erp5/r...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Apr 6 06:13:08 CEST 2010


Author: leonardo
Date: Tue Apr  6 06:13:07 2010
New Revision: 34289

URL: http://svn.erp5.org?rev=34289&view=rev
Log:
Add 'mkzopeinstance' recipe variable to accomodate installations with a Zope2 egg instead of a tarball install

Modified:
    erp5/trunk/utils/erp5.recipe.standaloneinstance/src/erp5/recipe/standaloneinstance/__init__.py

Modified: erp5/trunk/utils/erp5.recipe.standaloneinstance/src/erp5/recipe/standaloneinstance/__init__.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.recipe.standaloneinstance/src/erp5/recipe/standaloneinstance/__init__.py?rev=34289&r1=34288&r2=34289&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.recipe.standaloneinstance/src/erp5/recipe/standaloneinstance/__init__.py [utf8] (original)
+++ erp5/trunk/utils/erp5.recipe.standaloneinstance/src/erp5/recipe/standaloneinstance/__init__.py [utf8] Tue Apr  6 06:13:07 2010
@@ -36,6 +36,7 @@
         os.path.join(instancehome, 'var', 'Data.fs'))
     self.buildout, self.options, self.name = buildout, options, name
     self.zope2_location = options.get('zope2-location', '')
+    self.mkzopeinstance = options.get('mkzopeinstance', '')
 
     # Relative path support for the generated scripts
     relative_paths = options.get(
@@ -50,7 +51,7 @@
         assert relative_paths == 'false'
 
   def install(self):
-    # Override erp5.recipe.zope2instance so as to create several
+    # Override plone.recipe.zope2instance so as to create several
     # directories used by ERP5.
     options = self.options
     instancehome = options['instancehome']
@@ -68,12 +69,17 @@
     # patch the result. A better approach might be to provide independent
     # instance-creation logic, but this raises lots of issues that
     # need to be stored out first.
-    if not self.zope2_location:
-      mkzopeinstance = os.path.join(
-        options['bin-directory'], 'mkzopeinstance')
-      if not mkzopeinstance:
-        # EEE
-        return
+    
+    if self.mkzopeinstance:
+      mkzopeinstance = self.mkzopeinstance
+      if not os.path.exists(mkzopeinstance):
+        raise zc.buildout.UserError('could not find mkzopeinstance at %r' %
+                                    mkzopeinstance)
+    elif not self.zope2_location:
+      mkzopeinstance = os.path.join(options['bin-directory'], 'mkzopeinstance')
+      if not os.path.exists(mkzopeinstance):
+        raise zc.buildout.UserError('could not find mkzopeinstance at %r' %
+                                    mkzopeinstance)
 
     else:
       mkzopeinstance = os.path.join(
@@ -86,7 +92,9 @@
 
     if not mkzopeinstance:
       # EEE
-      return
+      raise zc.buildout.UserError('A "mkzopeinstance" script is necessary. '
+                                  'Please provide a "zope2-location" or '
+                                  '"mkzopeinstance" option.')
 
     assert os.spawnl(
       os.P_WAIT, os.path.normpath(options['executable']),
@@ -252,7 +260,7 @@
       return self.install()
 
   def patch_binaries(self, ws_locations):
-    if not self.zope2_location:
+    if not (self.zope2_location or self.mkzopeinstance):
       return
 
     instancehome = self.options['instancehome']




More information about the Erp5-report mailing list