r885 - in /zope2.9/trunk/debian: changelog patches/deb-zopeconf.dpatch

kobold at users.alioth.debian.org kobold at users.alioth.debian.org
Fri Jun 15 13:53:56 UTC 2007


Author: kobold
Date: Fri Jun 15 13:53:56 2007
New Revision: 885

URL: http://svn.debian.org/wsvn/pkg-zope/?sc=1&rev=885
Log:
Added support for custom ZEO servers while creating a new instance with mkzopeinstance.py.

Modified:
    zope2.9/trunk/debian/changelog
    zope2.9/trunk/debian/patches/deb-zopeconf.dpatch

Modified: zope2.9/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-zope/zope2.9/trunk/debian/changelog?rev=885&op=diff
==============================================================================
--- zope2.9/trunk/debian/changelog (original)
+++ zope2.9/trunk/debian/changelog Fri Jun 15 13:53:56 2007
@@ -1,3 +1,10 @@
+zope2.9 (2.9.7-2) unstable; urgency=low
+
+  * debian/patches/deb-zopeconf.dpatch: added support for custom ZEO servers
+    while creating a new instance with mkzopeinstance.py.
+
+ -- Fabio Tranchitella <kobold at debian.org>  Fri, 15 Jun 2007 15:24:30 +0200
+
 zope2.9 (2.9.7-1) unstable; urgency=low
 
   * New upstream release, including the fix for CVE-2007-0240.

Modified: zope2.9/trunk/debian/patches/deb-zopeconf.dpatch
URL: http://svn.debian.org/wsvn/pkg-zope/zope2.9/trunk/debian/patches/deb-zopeconf.dpatch?rev=885&op=diff
==============================================================================
--- zope2.9/trunk/debian/patches/deb-zopeconf.dpatch (original)
+++ zope2.9/trunk/debian/patches/deb-zopeconf.dpatch Fri Jun 15 13:53:56 2007
@@ -6,19 +6,21 @@
 . $(dirname $0)/DPATCH
 
 @DPATCH@
-diff -urN zope2.9-2.9.6/z/skel/etc/zope.conf.in zope2.9-2.9.6.debian/z/skel/etc/zope.conf.in
---- zope2.9-2.9.6/z/skel/etc/zope.conf.in	2006-10-02 17:53:36.000000000 +0200
-+++ zope2.9-2.9.6.debian/z/skel/etc/zope.conf.in	2006-11-02 21:02:15.000000000 +0100
-@@ -24,6 +24,8 @@
+diff -urN zope2.9-2.9.7/z/skel/etc/zope.conf.in zope2.9-2.9.7.debian/z/skel/etc/zope.conf.in
+--- zope2.9-2.9.7/z/skel/etc/zope.conf.in	2007-03-25 11:41:51.000000000 +0200
++++ zope2.9-2.9.7.debian/z/skel/etc/zope.conf.in	2007-06-15 15:09:10.000000000 +0200
+@@ -23,7 +23,10 @@
+ # ZConfig "defines" used for later textual substitution
  
  %define INSTANCE <<INSTANCE_HOME>>
++%define HTTPPORT <<ZOPE_HTTPPORT>>
  %define ZOPE <<ZOPE_HOME>>
 +%define ZOPE_USER <<ZOPE_USER>>
-+%define HTTPPORT <<ZOPE_HTTPPORT>>
++%define ZEO_SERVER <<ZEO_SERVER>>
  
  # Directive: instancehome
  #
-@@ -147,6 +149,7 @@
+@@ -147,6 +150,7 @@
  # Example:
  #
  #    effective-user chrism
@@ -26,7 +28,7 @@
  
  
  # Directive: enable-product-installation
-@@ -902,7 +905,7 @@
+@@ -902,7 +906,7 @@
  
  <http-server>
    # valid keys are "address" and "force-connection-close"
@@ -35,9 +37,77 @@
    # force-connection-close on
  </http-server>
  
-diff -urN zope2.9-2.9.6/z/utilities/copyzopeskel.py zope2.9-2.9.6.debian/z/utilities/copyzopeskel.py
---- zope2.9-2.9.6/z/utilities/copyzopeskel.py	2006-10-02 17:53:35.000000000 +0200
-+++ zope2.9-2.9.6.debian/z/utilities/copyzopeskel.py	2006-11-02 21:02:15.000000000 +0100
+@@ -951,13 +955,33 @@
+ #          IMPORTANT: At least one database with a mount-point of "/"
+ #          must be specified for Zope to start properly.
+ 
+-<zodb_db main>
+-    # Main FileStorage database
+-    <filestorage>
+-      path $INSTANCE/var/Data.fs
+-    </filestorage>
+-    mount-point /
+-</zodb_db>
++# ZODB: <zodb_db main>
++# ZODB:     # Main FileStorage database
++# ZODB:     <filestorage>
++# ZODB:       path $INSTANCE/var/Data.fs
++# ZODB:     </filestorage>
++# ZODB:     mount-point /
++# ZODB: </zodb_db>
++
++# Other storage examples
++#
++# ZEO client storage:
++#
++# ZEO: <zodb_db main>
++# ZEO:   mount-point /
++# ZEO:   # ZODB cache, in number of objects
++# ZEO:   cache-size 5000
++# ZEO:   <zeoclient>
++# ZEO:     server $ZEO_SERVER
++# ZEO:     storage 1
++# ZEO:     name zeostorage
++# ZEO:     var $INSTANCE/var
++# ZEO:     # ZEO client cache, in bytes
++# ZEO:     cache-size 20MB
++# ZEO:     # Uncomment to have a persistent disk cache
++# ZEO:     #client zeo1
++# ZEO:   </zeoclient>
++# ZEO: </zodb_db>
+ 
+ <zodb_db temporary>
+     # Temporary storage database (for sessions)
+@@ -968,26 +992,6 @@
+     container-class Products.TemporaryFolder.TemporaryContainer
+ </zodb_db>
+ 
+-# Other storage examples
+-#
+-# ZEO client storage:
+-#
+-# <zodb_db main>
+-#   mount-point /
+-#   # ZODB cache, in number of objects
+-#   cache-size 5000
+-#   <zeoclient>
+-#     server localhost:8100
+-#     storage 1
+-#     name zeostorage
+-#     var $INSTANCE/var
+-#     # ZEO client cache, in bytes
+-#     cache-size 20MB
+-#     # Uncomment to have a persistent disk cache
+-#     #client zeo1
+-#   </zeoclient>
+-# </zodb_db>
+-
+ # Product configuration (product-config) section(s)
+ #
+ # Description:
+diff -urN zope2.9-2.9.7/z/utilities/copyzopeskel.py zope2.9-2.9.7.debian/z/utilities/copyzopeskel.py
+--- zope2.9-2.9.7/z/utilities/copyzopeskel.py	2007-03-25 11:41:50.000000000 +0200
++++ zope2.9-2.9.7.debian/z/utilities/copyzopeskel.py	2007-06-15 14:59:03.000000000 +0200
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env python2.4
 +#!/usr/bin/python2.4
@@ -118,41 +188,49 @@
  def usage(stream, msg=None):
      if msg:
          print >>stream, msg
-diff -urN zope2.9-2.9.6/z/utilities/mkzopeinstance.py zope2.9-2.9.6.debian/z/utilities/mkzopeinstance.py
---- zope2.9-2.9.6/z/utilities/mkzopeinstance.py	2006-10-02 17:53:35.000000000 +0200
-+++ zope2.9-2.9.6.debian/z/utilities/mkzopeinstance.py	2006-11-02 21:16:48.000000000 +0100
-@@ -22,6 +22,9 @@
+diff -urN zope2.9-2.9.7/z/utilities/mkzopeinstance.py zope2.9-2.9.7.debian/z/utilities/mkzopeinstance.py
+--- zope2.9-2.9.7/z/utilities/mkzopeinstance.py	2007-03-25 11:41:50.000000000 +0200
++++ zope2.9-2.9.7.debian/z/utilities/mkzopeinstance.py	2007-06-15 15:22:36.000000000 +0200
+@@ -22,11 +22,16 @@
  -d/--dir  -- the dir in which the instance home should be created
  -u/--user NAME:PASSWORD -- set the user name and password of the initial user
  -s/--skelsrc -- the dir from which skeleton files should be copied
 +-l/--layout -- layout to use while copying the skeleton files (`fhs' or `zope')
 +--service-user -- system user to be used to run this instance (user:group)
 +--service-port -- HTTP port used to run this instance
++--zeo-server HOST:PORT -- use a ZEO server instead of a local ZODB database
  
  When run without arguments, this script will ask for the information necessary
  to create a Zope instance home.
-@@ -36,8 +39,8 @@
+ """
+ 
++import re
+ import getopt
+ import os
+ import shutil
+@@ -36,8 +41,8 @@
  def main():
      try:
          opts, args = getopt.getopt(sys.argv[1:],
 -            "hu:d:s:",
 -            ["help", "user=", "dir=", "skelsrc="]
 +            "hu:d:s:l:",
-+            ["help", "user=", "dir=", "skelsrc=", "layout=", "service-user=", "service-port="]
++            ["help", "user=", "dir=", "skelsrc=", "layout=", "service-user=", "service-port=", "zeo-server="]
              )
      except getopt.GetoptError, msg:
          usage(sys.stderr, msg)
-@@ -48,6 +51,9 @@
+@@ -48,6 +53,10 @@
      password = None
      skeltarget = None
      skelsrc = None
 +    srvport = 9673
 +    srvuser = "zope:zope"
++    zeoserver = None
 +    layout = "zope"
  
      for opt, arg in opts:
          if opt in ("-d", "--dir"):
-@@ -71,6 +77,28 @@
+@@ -71,6 +80,36 @@
                  usage(sys.stderr, "user must be specified as name:password")
                  sys.exit(2)
              user, password = arg.split(":", 1)
@@ -178,15 +256,24 @@
 +            except ValueError:
 +                usage(sys.stderr, "service port must be an integer")
 +                sys.exit(2)
++        if opt in ("--zeo-server"):
++            if not arg:
++                usage(sys.stderr, "zeo server must not be empty")
++                sys.exit(2)
++            if not ":" in arg:
++                usage(sys.stderr, "zeo server must be specified as host:port")
++                sys.exit(2)
++            zeoserver = arg
  
      if not skeltarget:
          # interactively ask for skeltarget and initial user name/passwd.
-@@ -119,9 +147,17 @@
+@@ -119,12 +158,28 @@
          "INSTANCE_HOME": instancehome,
          "SOFTWARE_HOME": softwarehome,
          "ZOPE_HOME": zopehome,
 +        "ZOPE_USER": srvuser.split(":")[0],
 +        "ZOPE_HTTPPORT": str(srvport),
++        "ZEO_SERVER": zeoserver or 'localhost:8100',
          }
  
 -    copyzopeskel.copyskel(skelsrc, skeltarget, None, None, **kw)
@@ -200,3 +287,13 @@
      if user and password:
          write_inituser(inituser, user, password)
  
++    zope_conf = os.path.join(skeltarget, 'etc', 'zope.conf')
++    re_zodb = re.compile('^# %s: ' % (zeoserver and 'ZEO' or 'ZODB')).sub
++    output = []
++    for r in open(zope_conf).readlines():
++        output.append(re_zodb('', r))
++    open(zope_conf, 'w').write(''.join(output))
++
+ def usage(stream, msg=None):
+     if msg:
+         print >>stream, msg




More information about the pkg-zope-commits mailing list