r2127 - in zope2.12/branches/with-revived-tarball/debian/patches (4 files)

pumazi-guest at users.alioth.debian.org pumazi-guest at users.alioth.debian.org
Tue Nov 9 19:49:49 UTC 2010


    Date: Tuesday, November 9, 2010 @ 19:49:27
  Author: pumazi-guest
Revision: 2127

Adding the patch back in.

Added:
  zope2.12/branches/with-revived-tarball/debian/patches/deb-zopeconf.patch
  zope2.12/branches/with-revived-tarball/debian/patches/webdav.patch
Modified:
  zope2.12/branches/with-revived-tarball/debian/patches/debian-changes-2.12.10-1
  zope2.12/branches/with-revived-tarball/debian/patches/series

Added: zope2.12/branches/with-revived-tarball/debian/patches/deb-zopeconf.patch
===================================================================
--- zope2.12/branches/with-revived-tarball/debian/patches/deb-zopeconf.patch	                        (rev 0)
+++ zope2.12/branches/with-revived-tarball/debian/patches/deb-zopeconf.patch	2010-11-09 19:49:27 UTC (rev 2127)
@@ -0,0 +1,236 @@
+Debian specific configuration
+--- a/source/Zope2/src/Zope2/utilities/copyzopeskel.py
++++ b/source/Zope2/src/Zope2/utilities/copyzopeskel.py
+@@ -1,3 +1,5 @@
++#!/usr/bin/env python
++
+ ##############################################################################
+ #
+ # Copyright (c) 2002 Zope Foundation and Contributors.
+@@ -162,7 +164,7 @@
+ 
+     copyskel(sourcedir, targetdir, uid, gid, **replacements)
+ 
+-def copyskel(sourcedir, targetdir, uid, gid, **replacements):
++def copyskel(sourcedir, targetdir, uid, gid, layout='zope', **replacements):
+     """ This is an independent function because we'd like to
+     import and call it from mkzopeinstance """
+     # Create the top of the instance:
+@@ -174,13 +176,22 @@
+     # with it.
+     pwd = os.getcwd()
+     os.chdir(sourcedir)
+-    try:
++    ##try:
++    if True:
+         try:
+             os.path.walk(os.curdir, copydir,
+                          (targetdir, replacements, uid, gid))
++            if layout == 'fhs':
++                movedir(os.path.join(targetdir, 'etc'),
++                        os.path.join('/etc/zope2.12', os.path.basename(targetdir)),
++                        uid, gid)
++                movedir(os.path.join(targetdir, 'log'),
++                        os.path.join('/var/log/zope2.12', os.path.basename(targetdir)),
++                        uid, gid)
+         finally:
+             os.chdir(pwd)
+-    except (IOError, OSError), msg:
++    ##except (IOError, OSError), msg:
++    else:
+         print >>sys.stderr, msg
+         sys.exit(1)
+ 
+@@ -240,6 +251,39 @@
+     if uid is not None:
+         os.chown(dst, uid, gid)
+ 
++def movedir(sourcedir, targetdir, uid, gid):
++    try:
++        os.makedirs(os.path.dirname(targetdir))
++        if uid is not None:
++            os.chown(os.path.dirname(targetdir), uid, gid)
++    except:
++        pass
++    if not os.path.isdir(targetdir):
++        shutil.move(sourcedir, targetdir)
++    elif os.path.islink(sourcedir):
++        return
++    else:
++        import glob
++        for src in glob.glob(sourcedir + '/*') + glob.glob(targetdir + '/.*'):
++            base = os.path.basename(src)
++            target = os.path.join(targetdir, base)
++            if os.path.exists(target):
++                backup = target + '.old'
++                if os.path.exists(backup):
++                    if os.path.isdir(backup):
++                        shutil.rmtree(backup, ignore_errors=True)
++                    else:
++                        os.unlink(backup)
++                os.rename(target, backup)
++            shutil.move(src, target)
++        shutil.rmtree(sourcedir, ignore_errors=True)
++    if uid is not None:
++        os.chown(targetdir, uid, gid)
++        for root, dirs, files in os.walk(targetdir):
++            for name in files + dirs:
++                os.chown(os.path.join(root, name), uid, gid)
++    os.symlink(targetdir, sourcedir)
++
+ def usage(stream, msg=None):
+     if msg:
+         print >>stream, msg
+--- a/source/Zope2/src/Zope2/utilities/mkzopeinstance.py
++++ b/source/Zope2/src/Zope2/utilities/mkzopeinstance.py
+@@ -1,3 +1,5 @@
++#!/usr/bin/env python
++
+ ##############################################################################
+ #
+ # Copyright (c) 2002 Zope Foundation and Contributors.
+@@ -21,11 +23,16 @@
+ -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
+ -p/--python -- the Python interpreter to use
++-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.
+ """
+ 
++import re
+ import getopt
+ import os
+ import sys
+@@ -34,8 +41,8 @@
+ def main():
+     try:
+         opts, args = getopt.getopt(sys.argv[1:],
+-            "hu:d:s:p:",
+-            ["help", "user=", "dir=", "skelsrc=", "python="]
++            "hu:d:s:p:l:",
++            ["help", "user=", "dir=", "skelsrc=", "python=", "layout=", "service-user=", "service-port=", "zeo-server="]
+             )
+     except getopt.GetoptError, msg:
+         usage(sys.stderr, msg)
+@@ -47,6 +54,10 @@
+     skeltarget = None
+     skelsrc = None
+     python = None
++    layout = 'zope'
++    srvuser = 'zope:zope'
++    srvport = 9673
++    zeoserver = None
+ 
+     if check_buildout(script_path):
+         python = os.path.join(script_path, 'zopepy')
+@@ -78,6 +89,36 @@
+                 usage(sys.stderr, "user must be specified as name:password")
+                 sys.exit(2)
+             user, password = arg.split(":", 1)
++        if opt in ("--layout",):
++            if not arg or arg not in ('fhs', 'zope'):
++                usage(sys.stderr, "layout to use while copying the skeleton files (`fhs' or `zope')")
++                sys.exit(2)
++            layout = arg
++        if opt in ("--service-user",):
++            if not arg:
++                usage(sys.stderr, "service user must not be empty")
++                sys.exit(2)
++            if not ":" in arg:
++                usage(sys.stderr, "service user must be specified as user:group")
++                sys.exit(2)
++            srvuser = arg
++        if opt in ("--service-port",):
++            if not arg:
++                usage(sys.stderr, "service port must not be empty")
++                sys.exit(2)
++            try:
++                srvport = int(arg)
++            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.
+@@ -129,12 +170,28 @@
+         "INSTANCE_HOME": instancehome,
+         "ZOPE_SCRIPTS": script_path,
+         "ZOPE2PATH": zope2path,
++        "ZOPE_USER": srvuser.split(":")[0],
++        "ZOPE_HTTPPORT": str(srvport),
++        "ZEO_SERVER": zeoserver or 'localhost:8100',
+         }
+ 
+-    copyzopeskel.copyskel(skelsrc, skeltarget, None, None, **kw)
++    import pwd, grp
++    uid = pwd.getpwnam(srvuser.split(":")[0])
++    if uid: uid = uid[2]
++    gid = grp.getgrnam(srvuser.split(":")[1])
++    if gid: gid = gid[2]
++
++    copyzopeskel.copyskel(skelsrc, skeltarget, uid, gid, layout, **kw)
+     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
+--- a/source/Zope2/src/Zope2/utilities/skel/etc/zope.conf.in
++++ b/source/Zope2/src/Zope2/utilities/skel/etc/zope.conf.in
+@@ -23,6 +23,9 @@
+ # ZConfig "defines" used for later textual substitution
+ 
+ %define INSTANCE <<INSTANCE_HOME>>
++%define HTTPPORT <<ZOPE_HTTPPORT>>
++%define ZOPE_USER <<ZOPE_USER>>
++%define ZEO_SERVER <<ZEO_SERVER>>
+ 
+ # Directive: instancehome
+ #
+@@ -146,7 +149,7 @@
+ # Example:
+ #
+ #    effective-user chrism
+-
++effective-user $ZOPE_USER
+ 
+ # Directive: enable-product-installation
+ #
+@@ -964,7 +967,7 @@
+ 
+ <http-server>
+   # valid keys are "address" and "force-connection-close"
+-  address 8080
++  address $HTTPPORT
+ 
+   # force-connection-close on
+   #
+@@ -1065,7 +1068,7 @@
+ #   <zeoclient>
+ #     # See .../ZODB/component.xml for directives (sectiontype
+ #     # "zeoclient").
+-#     server localhost:8100
++#     server $ZEO_SERVER
+ #     storage 1
+ #     name zeostorage
+ #     var $INSTANCE/var

Modified: zope2.12/branches/with-revived-tarball/debian/patches/debian-changes-2.12.10-1
===================================================================
--- zope2.12/branches/with-revived-tarball/debian/patches/debian-changes-2.12.10-1	2010-11-09 17:03:00 UTC (rev 2126)
+++ zope2.12/branches/with-revived-tarball/debian/patches/debian-changes-2.12.10-1	2010-11-09 19:49:27 UTC (rev 2127)
@@ -9,6 +9,8 @@
    * Adding python-pkg-resources and python-virtualenv as build
      dependencies.
    * Modified the watch file to point at the new tarball location.
+   * Rewrote the rules file to use the newest style debhelper with override
+     support.
  .
  The person named in the Author field signed this changelog entry.
 Author: Michael Mulich (pumazi) <michael.mulich at gmail.com>

Modified: zope2.12/branches/with-revived-tarball/debian/patches/series
===================================================================
--- zope2.12/branches/with-revived-tarball/debian/patches/series	2010-11-09 17:03:00 UTC (rev 2126)
+++ zope2.12/branches/with-revived-tarball/debian/patches/series	2010-11-09 19:49:27 UTC (rev 2127)
@@ -1 +1,3 @@
 debian-changes-2.12.10-1
+webdav.patch
+deb-zopeconf.patch

Added: zope2.12/branches/with-revived-tarball/debian/patches/webdav.patch
===================================================================
--- zope2.12/branches/with-revived-tarball/debian/patches/webdav.patch	                        (rev 0)
+++ zope2.12/branches/with-revived-tarball/debian/patches/webdav.patch	2010-11-09 19:49:27 UTC (rev 2127)
@@ -0,0 +1,12 @@
+
+--- a/source/Zope2/src/webdav/davcmds.py
++++ b/source/Zope2/src/webdav/davcmds.py
+@@ -173,7 +173,7 @@
+                     if dflag:
+                         ob._p_deactivate()
+                 elif hasattr(ob, '__dav_resource__'):
+-                    uri = urljoin(url, absattr(ob.getId()))
++                    uri = urljoin(url, quote(absattr(ob.getId())))
+                     depth = depth=='infinity' and depth or 0
+                     self.apply(ob, uri, depth, result, top=0)
+                     if dflag:




More information about the pkg-zope-developers mailing list