[Erp5-report] r7868 - /spec/mandriva/2006.0/erp5-zope/

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jun 19 17:25:21 CEST 2006


Author: kevin
Date: Mon Jun 19 17:25:15 2006
New Revision: 7868

URL: http://svn.erp5.org?rev=7868&view=rev
Log:
Commit erp5-zope-2.7.8.final-2mdk spec files and patches

Added:
    spec/mandriva/2006.0/erp5-zope/
    spec/mandriva/2006.0/erp5-zope/README.install.urpmi.zope   (with props)
    spec/mandriva/2006.0/erp5-zope/Zope-2.7.2-rc1-aq_dynamic.patch
    spec/mandriva/2006.0/erp5-zope/erp5-zope.spec   (with props)

Added: spec/mandriva/2006.0/erp5-zope/README.install.urpmi.zope
URL: http://svn.erp5.org/spec/mandriva/2006.0/erp5-zope/README.install.urpmi.zope?rev=7868&view=auto
==============================================================================
--- spec/mandriva/2006.0/erp5-zope/README.install.urpmi.zope (added)
+++ spec/mandriva/2006.0/erp5-zope/README.install.urpmi.zope Mon Jun 19 17:25:15 2006
@@ -1,0 +1,3 @@
+A Zope instance has been installed.  Run it via \"/etc/rc.d/init.d/zope start\".
+Log in via a browser on port 9080.
+You can add an administrative user with \"zopectl adduser admin admin_passwd\".

Propchange: spec/mandriva/2006.0/erp5-zope/README.install.urpmi.zope
------------------------------------------------------------------------------
    svn:executable = *

Added: spec/mandriva/2006.0/erp5-zope/Zope-2.7.2-rc1-aq_dynamic.patch
URL: http://svn.erp5.org/spec/mandriva/2006.0/erp5-zope/Zope-2.7.2-rc1-aq_dynamic.patch?rev=7868&view=auto
==============================================================================
--- spec/mandriva/2006.0/erp5-zope/Zope-2.7.2-rc1-aq_dynamic.patch (added)
+++ spec/mandriva/2006.0/erp5-zope/Zope-2.7.2-rc1-aq_dynamic.patch Mon Jun 19 17:25:15 2006
@@ -1,0 +1,644 @@
+diff -urN Zope-2.7.2-rc1.orig/lib/Components/ExtensionClass/src/Acquisition.c Zope-2.7.2-rc1/lib/Components/ExtensionClass/src/Acquisition.c
+--- Zope-2.7.2-rc1.orig/lib/Components/ExtensionClass/src/Acquisition.c	2003-10-21 14:44:39.000000000 +0200
++++ Zope-2.7.2-rc1/lib/Components/ExtensionClass/src/Acquisition.c	2005-02-01 01:04:12.617262632 +0100
+@@ -81,7 +81,7 @@
+   INIT_PY_NAME(__repr__);
+   INIT_PY_NAME(__str__);
+   INIT_PY_NAME(__cmp__);
+-  
++
+ #undef INIT_PY_NAME
+ }
+ 
+@@ -150,13 +150,13 @@
+   PyTuple_SET_ITEM(t,0,NULL);
+   Py_DECREF(t);
+ 
+-  if (r 
++  if (r
+       && r->ob_refcnt==1
+-      && isWrapper(r) 
++      && isWrapper(r)
+       && WRAPPER(r)->container && isWrapper(WRAPPER(r)->container)
+       )
+     while (WRAPPER(r)->obj && isWrapper(WRAPPER(r)->obj)
+-	   && (WRAPPER(WRAPPER(r)->obj)->container == 
++	   && (WRAPPER(WRAPPER(r)->obj)->container ==
+ 	       WRAPPER(WRAPPER(r)->container)->obj)
+ 	   )
+       {
+@@ -179,7 +179,7 @@
+ newWrapper(PyObject *obj, PyObject *container, PyTypeObject *Wrappertype)
+ {
+   Wrapper *self;
+-  
++
+   if (freeWrappers)
+     {
+       self=freeWrappers;
+@@ -211,7 +211,7 @@
+ 
+ 
+ static void
+-Wrapper_dealloc(Wrapper *self)     
++Wrapper_dealloc(Wrapper *self)
+ {
+   Py_XDECREF(self->obj);
+   Py_XDECREF(self->container);
+@@ -223,7 +223,7 @@
+       freeWrappers=self;
+       nWrappers++;
+     }
+-  else 
++  else
+     {
+       PyObject_DEL(self);
+     }
+@@ -271,7 +271,7 @@
+       if (strcmp(name,"explicit")==0)
+ 	{
+ 	  if (self->ob_type != (PyTypeObject *)&XaqWrappertype)
+-	    return newWrapper(self->obj, self->container, 
++	    return newWrapper(self->obj, self->container,
+ 			      (PyTypeObject *)&XaqWrappertype);
+ 	  Py_INCREF(self);
+ 	  return OBJECT(self);
+@@ -291,7 +291,7 @@
+ 	      {
+ 		if (PyList_Append(r,OBJECT(self)) >= 0)
+ 		  {
+-		    if (isWrapper(self) && self->container) 
++		    if (isWrapper(self) && self->container)
+ 		      {
+ 			self=WRAPPER(self->container);
+ 			continue;
+@@ -316,7 +316,7 @@
+ 	  if (self->obj)
+ 	    {
+ 	      r=self->obj;
+-	      while (isWrapper(r) && WRAPPER(r)->obj) 
++	      while (isWrapper(r) && WRAPPER(r)->obj)
+ 		{
+ 		  self=WRAPPER(r);
+ 		  r=WRAPPER(r)->obj;
+@@ -336,7 +336,7 @@
+ 	  return PyString_FromString("Bob");
+ 	}
+       break;
+-      
++
+     }
+ 
+   return NULL;
+@@ -382,7 +382,65 @@
+ }
+ 
+ static PyObject *
+-Wrapper_acquire(Wrapper *self, PyObject *oname, 
++Wrapper_GetAttr(PyObject *self, PyObject *attr_name, PyObject *orig)
++{
++  /* This function retrieves an attribute from an object by PyObject_GetAttr.
++
++     The main difference between Wrapper_GetAttr and PyObject_GetAttr is that
++     Wrapper_GetAttr calls _aq_dynamic to generate an attribute dynamically, if
++     the attribute is not found.
++  */
++  PyObject *r, *v, *tb;
++  PyObject *d, *m;
++  PyObject *o;
++
++  if (isWrapper (self))
++    o = WRAPPER(self)->obj;
++  else
++    o = self;
++  
++  /* Try to get an attribute in the normal way first.  */
++  r = PyObject_GetAttr(o, attr_name);
++  if (r)
++    return r;
++
++  /* If an unexpected error happens, return immediately.  */
++  PyErr_Fetch(&r,&v,&tb);
++  if (r != PyExc_AttributeError)
++    {
++      PyErr_Restore(r,v,tb);
++      return NULL;
++    }
++
++  /* Try to get _aq_dynamic.  */
++  m = PyObject_GetAttrString(o, "_aq_dynamic");
++  if (! m) {
++    PyErr_Restore(r,v,tb);
++    return NULL;
++  }
++
++  /* Call _aq_dynamic in the context of the original acquisition wrapper.  */
++  if (PyECMethod_Check(m) && PyECMethod_Self(m)==o)
++    ASSIGN(m,PyECMethod_New(m,OBJECT(self)));
++  else if (has__of__(m)) ASSIGN(m,__of__(m,OBJECT(self)));
++  d = PyObject_CallFunction(m, "O", attr_name);
++  Py_DECREF(m);
++
++  /* In the case of None, assume that the attribute is not found.  */
++  if (d == Py_None) {
++    Py_DECREF(d);
++    PyErr_Restore(r,v,tb);
++    return NULL;
++  }
++
++  Py_XDECREF(r);
++  Py_XDECREF(v);
++  Py_XDECREF(tb);
++  return d;
++}
++
++static PyObject *
++Wrapper_acquire(Wrapper *self, PyObject *oname,
+ 		PyObject *filter, PyObject *extra, PyObject *orig,
+ 		int explicit, int containment);
+ 
+@@ -409,7 +467,7 @@
+     else PyErr_Clear();
+   else if (*name=='_' && name[1]=='_' && strcmp(name+2,"reduce__")==0)
+     {
+-      PyErr_SetString(PyExc_TypeError, 
++      PyErr_SetString(PyExc_TypeError,
+                       "Can't pickle objects in acquisition wrappers.");
+       return NULL;
+     }
+@@ -429,12 +487,12 @@
+ 		return NULL;
+ 	  }
+ 	  if ((r=Wrapper_findattr(WRAPPER(self->obj),
+-				 oname, filter, extra, orig, 1, 
++				 oname, filter, extra, orig, 1,
+ 
+ 				 /* Search object container if explicit,
+ 				    or object is implicit acquirer */
+ 				 explicit ||
+-				 self->obj->ob_type == 
++				 self->obj->ob_type ==
+ 				 (PyTypeObject*)&Wrappertype,
+ 				  explicit, containment)))
+ 	    {
+@@ -453,12 +511,12 @@
+ 	  Py_XDECREF(r); Py_XDECREF(v); Py_XDECREF(tb);
+ 	  r=NULL;
+ 	}
+-      else if ((r=PyObject_GetAttr(self->obj,oname)))
++      else if ((r=Wrapper_GetAttr(OBJECT(self),oname,orig)))
+ 	{
+ 	  if (r==Acquired)
+ 	    {
+ 	      Py_DECREF(r);
+-	      return Wrapper_acquire(self, oname, filter, extra, orig, 1, 
++	      return Wrapper_acquire(self, oname, filter, extra, orig, 1,
+ 				     containment);
+ 	    }
+ 
+@@ -487,8 +545,8 @@
+       PyErr_Clear();
+     }
+ 
+-  if (sco && (*name != '_' || explicit)) 
+-    return Wrapper_acquire(self, oname, filter, extra, orig, explicit, 
++  if (sco && (*name != '_' || explicit))
++    return Wrapper_acquire(self, oname, filter, extra, orig, explicit,
+ 			   containment);
+ 
+   PyErr_SetObject(PyExc_AttributeError,oname);
+@@ -496,7 +554,7 @@
+ }
+ 
+ static PyObject *
+-Wrapper_acquire(Wrapper *self, PyObject *oname, 
++Wrapper_acquire(Wrapper *self, PyObject *oname,
+ 		PyObject *filter, PyObject *extra, PyObject *orig,
+ 		int explicit, int containment)
+ {
+@@ -511,23 +569,23 @@
+ 	    {
+ 	      /* Try to optimize search by recognizing repeated obs in path */
+ 	      if (WRAPPER(self->obj)->container==
+-		  WRAPPER(self->container)->container) 
++		  WRAPPER(self->container)->container)
+ 		sco=0;
+ 	      else if (WRAPPER(self->obj)->container==
+-		      WRAPPER(self->container)->obj)  
++		      WRAPPER(self->container)->obj)
+ 		sob=0;
+ 	   }
+ 
+ 	  r=Wrapper_findattr((Wrapper*)self->container,
+-			     oname, filter, extra, orig, sob, sco, explicit, 
++			     oname, filter, extra, orig, sob, sco, explicit,
+ 			     containment);
+-	  
++
+ 	  if (r && has__of__(r)) ASSIGN(r,__of__(r,OBJECT(self)));
+ 	  return r;
+ 	}
+       else
+ 	{
+-	  if ((r=PyObject_GetAttr(self->container,oname))) {
++	  if ((r=Wrapper_GetAttr(self->container,oname,orig))) {
+ 	    if (r == Acquired) {
+ 	      Py_DECREF(r);
+ 	    }
+@@ -536,9 +594,9 @@
+ 		switch(apply_filter(filter,self->container,oname,r,
+ 				    extra,orig))
+ 		  {
+-		  case -1: 
++		  case -1:
+ 		    return NULL;
+-		  case 1: 
++		  case 1:
+ 		    if (has__of__(r)) ASSIGN(r,__of__(r,OBJECT(self)));
+ 		    return r;
+ 		  }
+@@ -555,7 +613,7 @@
+ 	  }
+ 	}
+     }
+-  
++
+   PyErr_SetObject(PyExc_AttributeError, oname);
+   return NULL;
+ }
+@@ -564,7 +622,7 @@
+ Wrapper_getattro(Wrapper *self, PyObject *oname)
+ {
+   if (self->obj || self->container)
+-    return Wrapper_findattr(self, oname, NULL, NULL, NULL, 1, 1, 0, 0);
++    return Wrapper_findattr(self, oname, NULL, NULL, OBJECT(self), 1, 1, 0, 0);
+ 
+   /* Maybe we are getting initialized? */
+   return Py_FindAttr(OBJECT(self),oname);
+@@ -581,7 +639,7 @@
+     return Py_FindAttr(OBJECT(self),oname);
+ 
+   if (self->obj || self->container)
+-    return Wrapper_findattr(self, oname, NULL, NULL, NULL, 1, 0, 0, 0);
++    return Wrapper_findattr(self, oname, NULL, NULL, OBJECT(self), 1, 0, 0, 0);
+ 
+   /* Maybe we are getting initialized? */
+   return Py_FindAttr(OBJECT(self),oname);
+@@ -594,7 +652,7 @@
+ 
+   /* Allow assignment to parent, to change context. */
+   if (PyString_Check(oname)) name=PyString_AS_STRING(oname);
+-  if (*name=='a' && name[1]=='q' && name[2]=='_' 
++  if (*name=='a' && name[1]=='q' && name[2]=='_'
+       && strcmp(name+3,"parent")==0)
+     {
+       Py_XINCREF(v);
+@@ -612,7 +670,7 @@
+       else   return PyObject_DelAttr(self->obj, oname);
+     }
+ 
+-  PyErr_SetString(PyExc_AttributeError, 
++  PyErr_SetString(PyExc_AttributeError,
+ 		  "Attempt to set attribute on empty acquisition wrapper");
+   return -1;
+ }
+@@ -648,12 +706,12 @@
+ 
+   ASSIGN(m, PyObject_CallFunction(m, "O", w));
+   UNLESS (m) return -1;
+-  
++
+   r=PyInt_AsLong(m);
+ 
+   Py_DECREF(m);
+ 
+-  return r;  
++  return r;
+ }
+ 
+ static PyObject *
+@@ -914,7 +972,7 @@
+   return CallMethodO(OBJECT(self),py__or__,Build("(O)", o),NULL);
+ }
+ 
+-static int 
++static int
+ Wrapper_coerce(Wrapper **self, PyObject **o)
+ {
+   PyObject *m;
+@@ -938,7 +996,7 @@
+ 
+ err:
+   Py_DECREF(m);
+-  return -1;  
++  return -1;
+ }
+ 
+ static PyObject *
+@@ -1049,7 +1107,7 @@
+   if (filter==Py_None) filter=0;
+ 
+   result=Wrapper_findattr(self,name,filter,extra,OBJECT(self),1,
+-			  explicit || 
++			  explicit ||
+ 			  self->ob_type==(PyTypeObject*)&Wrappertype,
+ 			  explicit, containment);
+   if (result == NULL && defalt != NULL) {
+@@ -1122,10 +1180,10 @@
+ static struct PyMethodDef Wrapper_methods[] = {
+   {"__init__", (PyCFunction)Wrapper__init__, 0,
+    "Initialize an Acquirer Wrapper"},
+-  {"acquire", (PyCFunction)Wrapper_acquire_method, 
++  {"acquire", (PyCFunction)Wrapper_acquire_method,
+    METH_VARARGS|METH_KEYWORDS,
+    "Get an attribute, acquiring it if necessary"},
+-  {"aq_acquire", (PyCFunction)Wrapper_acquire_method, 
++  {"aq_acquire", (PyCFunction)Wrapper_acquire_method,
+    METH_VARARGS|METH_KEYWORDS,
+    "Get an attribute, acquiring it if necessary"},
+   {"aq_inContextOf", (PyCFunction)Wrapper_inContextOf, METH_VARARGS,
+@@ -1228,15 +1286,15 @@
+ }
+ 
+ static struct PyMethodDef Acquirer_methods[] = {
+-  {"__of__",(PyCFunction)acquire_of, METH_VARARGS, 
++  {"__of__",(PyCFunction)acquire_of, METH_VARARGS,
+    "__of__(context) -- return the object in a context"},
+-  
++
+   {NULL,		NULL}		/* sentinel */
+ };
+ 
+ static struct PyMethodDef Xaq_methods[] = {
+   {"__of__",(PyCFunction)xaq_of, METH_VARARGS,""},
+-  
++
+   {NULL,		NULL}		/* sentinel */
+ };
+ 
+@@ -1244,26 +1302,26 @@
+ capi_aq_acquire(PyObject *self, PyObject *name, PyObject *filter,
+ 	PyObject *extra, int explicit, PyObject *defalt, int containment)
+ {
+-  
++
+   PyObject *result;
+ 
+   if (filter==Py_None) filter=0;
+ 
+   /* We got a wrapped object, so business as usual */
+-  if (isWrapper(self)) 
++  if (isWrapper(self))
+     return Wrapper_findattr(
+ 	      WRAPPER(self), name, filter, extra, OBJECT(self),1,
+-	      explicit || 
++	      explicit ||
+ 	      WRAPPER(self)->ob_type==(PyTypeObject*)&Wrappertype,
+ 	      explicit, containment);
+-  
++
+   /* Not wrapped and no filter, so just getattr */
+   if (! filter) return PyObject_GetAttr(self, name);
+ 
+   /* Crap, we've got to construct a wrapper so we can use Wrapper_findattr */
+-  UNLESS (self=newWrapper(self, NULL, (PyTypeObject*)&Wrappertype)) 
++  UNLESS (self=newWrapper(self, NULL, (PyTypeObject*)&Wrappertype))
+     return NULL;
+-  
++
+   result=Wrapper_findattr(WRAPPER(self), name, filter, extra, OBJECT(self),
+ 			   1, 1, explicit, containment);
+ 
+@@ -1298,8 +1356,8 @@
+ {
+   PyObject *result = NULL;
+   /* We got a wrapped object, so business as usual */
+-  if (isWrapper(self)) 
+-    result=Wrapper_findattr(WRAPPER(self), name, 0, 0, OBJECT(self), 1, 1, 1, 
++  if (isWrapper(self))
++    result=Wrapper_findattr(WRAPPER(self), name, 0, 0, OBJECT(self), 1, 1, 1,
+ 		       containment);
+   else
+     result=PyObject_GetAttr(self, name);
+@@ -1310,7 +1368,7 @@
+       result=defalt;
+       Py_INCREF(result);
+     }
+-  
++
+   return result;
+ }
+ 
+@@ -1320,14 +1378,14 @@
+ {
+   PyObject *self, *name, *defalt=0;
+   int containment=0;
+-  
+-  UNLESS (PyArg_ParseTuple(args, "OO|Oi", 
++
++  UNLESS (PyArg_ParseTuple(args, "OO|Oi",
+ 			   &self, &name, &defalt, &containment
+ 			   )) return NULL;
+   return capi_aq_get(self, name, defalt, containment);
+ }
+ 
+-static int 
++static int
+ capi_aq_iswrapper(PyObject *self) {
+ 	return isWrapper(self);
+ }
+@@ -1336,12 +1394,12 @@
+ capi_aq_base(PyObject *self)
+ {
+   PyObject *result;
+-  if (! isWrapper(self)) 
++  if (! isWrapper(self))
+     {
+       Py_INCREF(self);
+       return self;
+     }
+-  
++
+   if (WRAPPER(self)->obj)
+     {
+       result=WRAPPER(self)->obj;
+@@ -1388,12 +1446,12 @@
+ capi_aq_self(PyObject *self)
+ {
+   PyObject *result;
+-  if (! isWrapper(self)) 
++  if (! isWrapper(self))
+     {
+       Py_INCREF(self);
+       return self;
+     }
+-  
++
+   if (WRAPPER(self)->obj) result=WRAPPER(self)->obj;
+   else result=Py_None;
+ 
+@@ -1413,7 +1471,7 @@
+ capi_aq_inner(PyObject *self)
+ {
+   PyObject *result;
+-  if (! isWrapper(self)) 
++  if (! isWrapper(self))
+     {
+       Py_INCREF(self);
+       return self;
+@@ -1422,7 +1480,7 @@
+   if (WRAPPER(self)->obj)
+     {
+       result=WRAPPER(self)->obj;
+-      while (isWrapper(result) && WRAPPER(result)->obj) 
++      while (isWrapper(result) && WRAPPER(result)->obj)
+ 	{
+ 	  self=result;
+ 	  result=WRAPPER(result)->obj;
+@@ -1463,7 +1521,7 @@
+ 	      if (PyList_Append(result,OBJECT(self)) < 0)
+ 		goto err;
+ 	    }
+-	  if (WRAPPER(self)->container) 
++	  if (WRAPPER(self)->container)
+ 	    {
+ 	      self=WRAPPER(self)->container;
+ 	      continue;
+@@ -1475,7 +1533,7 @@
+ 
+       break;
+     }
+-  
++
+   return result;
+ err:
+   Py_DECREF(result);
+@@ -1495,7 +1553,7 @@
+ }
+ 
+ static struct PyMethodDef methods[] = {
+-  {"aq_acquire", (PyCFunction)module_aq_acquire, METH_VARARGS|METH_KEYWORDS, 
++  {"aq_acquire", (PyCFunction)module_aq_acquire, METH_VARARGS|METH_KEYWORDS,
+    "aq_acquire(ob, name [, filter, extra, explicit]) -- "
+    "Get an attribute, acquiring it if necessary"
+   },
+@@ -1503,16 +1561,16 @@
+    "aq_get(ob, name [, default]) -- "
+    "Get an attribute, acquiring it if necessary."
+   },
+-  {"aq_base", (PyCFunction)module_aq_base, METH_VARARGS, 
++  {"aq_base", (PyCFunction)module_aq_base, METH_VARARGS,
+    "aq_base(ob) -- Get the object unwrapped"},
+-  {"aq_parent", (PyCFunction)module_aq_parent, METH_VARARGS, 
++  {"aq_parent", (PyCFunction)module_aq_parent, METH_VARARGS,
+    "aq_parent(ob) -- Get the parent of an object"},
+-  {"aq_self", (PyCFunction)module_aq_self, METH_VARARGS, 
++  {"aq_self", (PyCFunction)module_aq_self, METH_VARARGS,
+    "aq_self(ob) -- Get the object with the outermost wrapper removed"},
+-  {"aq_inner", (PyCFunction)module_aq_inner, METH_VARARGS, 
++  {"aq_inner", (PyCFunction)module_aq_inner, METH_VARARGS,
+    "aq_inner(ob) -- "
+    "Get the object with alll but the innermost wrapper removed"},
+-  {"aq_chain", (PyCFunction)module_aq_chain, METH_VARARGS, 
++  {"aq_chain", (PyCFunction)module_aq_chain, METH_VARARGS,
+    "aq_chain(ob [, containment]) -- "
+    "Get a list of objects in the acquisition environment"},
+   {NULL,	NULL}
+diff -urN Zope-2.7.2-rc1.orig/lib/Components/ExtensionClass/test/test_dynamic_acquisition.py Zope-2.7.2-rc1/lib/Components/ExtensionClass/test/test_dynamic_acquisition.py
+--- Zope-2.7.2-rc1.orig/lib/Components/ExtensionClass/test/test_dynamic_acquisition.py	1970-01-01 01:00:00.000000000 +0100
++++ Zope-2.7.2-rc1/lib/Components/ExtensionClass/test/test_dynamic_acquisition.py	2005-02-01 01:03:50.469629584 +0100
+@@ -0,0 +1,94 @@
++##############################################################################
++#
++# Copyright (c) 1996-2002 Zope Corporation and Contributors.
++# All Rights Reserved.
++#
++# This software is subject to the provisions of the Zope Public License,
++# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
++# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
++# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
++# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
++# FOR A PARTICULAR PURPOSE
++#
++##############################################################################
++from ExtensionClass import Base
++import Acquisition
++
++def log(message):
++    print message
++    return message
++    
++class B(Acquisition.Implicit):
++    color='red'
++    def _aq_dynamic(self, attr):
++        if attr == 'bonjour': return None
++        return lambda: log(self.__class__.__name__ + ':' + attr)
++
++class A(Acquisition.Implicit):
++    def hi(self):
++        print "%s()" % self.__class__.__name__, self.color
++    def _aq_dynamic(self, attr): return None
++
++
++b=B()
++b.a=A()
++b.a.hi()
++b.a.color='green'
++b.a.hi()
++
++b.a.salut()
++a=A()
++a.b=B()
++a.b.salut()
++
++try:
++  b.a.bonjour()
++except AttributeError: pass
++
++try:
++  a.b.bonjour()
++except AttributeError: pass
++
++try:
++    A().hi()
++    raise 'Program error', 'spam'
++except AttributeError: pass
++
++#
++#   New test for wrapper comparisons.
++#
++foo = b.a
++bar = b.a
++assert( foo == bar )
++c = A()
++b.c = c
++b.c.d = c
++assert( b.c.d == c )
++assert( b.c.d == b.c )
++assert( b.c == c )
++
++
++def checkContext(self, o):
++    # Python equivalent to aq_inContextOf
++    from Acquisition import aq_base, aq_parent, aq_inner
++    subob = self
++    o = aq_base(o)
++    while 1:
++        if aq_base(subob) is o: return 1
++        self = aq_inner(subob)
++        if self is None: break
++        subob = aq_parent(self)
++        if subob is None: break
++
++
++assert checkContext(b.c, b)
++assert not checkContext(b.c, b.a)
++
++assert b.a.aq_inContextOf(b)
++assert b.c.aq_inContextOf(b)
++assert b.c.d.aq_inContextOf(b)
++assert b.c.d.aq_inContextOf(c)
++assert b.c.d.aq_inContextOf(b.c)
++assert not b.c.aq_inContextOf(foo)
++assert not b.c.aq_inContextOf(b.a)
++assert not b.a.aq_inContextOf('somestring')

Added: spec/mandriva/2006.0/erp5-zope/erp5-zope.spec
URL: http://svn.erp5.org/spec/mandriva/2006.0/erp5-zope/erp5-zope.spec?rev=7868&view=auto
==============================================================================
--- spec/mandriva/2006.0/erp5-zope/erp5-zope.spec (added)
+++ spec/mandriva/2006.0/erp5-zope/erp5-zope.spec Mon Jun 19 17:25:15 2006
@@ -1,0 +1,298 @@
+%define realVersion 2.7.8-final
+%define name zope
+%define release 2
+
+%define version %(echo %{realVersion} | sed -e's/-/./g')
+%define sVersion %(echo %{realVersion} | cut -d- -f1)
+
+
+Summary:       The patched version of Zope application server for ERP5
+Name:          erp5-%{name}
+Version:       %{version}
+Release:       %mkrel %{release}
+License:       Zope Public License (ZPL)
+Group:         System/Servers
+URL:           http://www.zope.org/
+Source0:       http://zope.org/Products/Zope/%{sVersion}/Zope-%{realVersion}.tar.bz2
+Source1:       skel.tar.bz2
+Source2:       http://www.zope.org/Members/michel/ZB/ZopeBook.tar.bz2
+Source3:       README.install.urpmi.zope
+Patch0:        Zope-2.7.2-rc1-aq_dynamic.patch.bz2
+Requires:      python >= 2.3.3
+BuildRequires: python-devel >= 2.3.3
+BuildRoot:     %{_tmppath}/%{name}-%{version}-root-%(id -u -n)
+Provides:      zope
+
+%define python /usr/bin/python
+%define zopehome /usr/lib/zope
+%define softwarehome %{zopehome}/lib/python
+%define instancehome /var/lib/zope
+%define clienthome %{instancehome}/data
+%define statehome /var/run/zope
+%define loghome /var/log/zope
+%define configfile /etc/zope.conf
+%define zopectl /usr/bin/zopectl
+%define runzope /usr/bin/runzope
+%define zopeuser zope
+
+%description
+Zope is an open source application server for building content managements,
+intranets, portals, and custom applications. The Zope community consists of
+hundreds of companies and thousands of developers all over the world, working
+on building the platform and Zope applications. Zope is written in Python, a
+highly-productive, object-oriented scripting language.
+
+This version contain a patch from Nexedi about dynamic acquisition in order to
+make ERP5 working well.
+
+%prep
+%setup -q -n Zope-%{realVersion}
+
+%patch0 -p1
+
+# Add skel
+rm -rf skel
+tar xvjf %{SOURCE1}
+#rm skel/var/log/zope/README.txt skel/var/run/zope/README.txt
+
+# Prepare doc (Zope Book)
+tar xjf %{SOURCE2}
+
+
+%build
+mkdir -p build
+pushd build
+../configure \
+  --with-python="%{python}" \
+  --prefix="%{buildroot}%{zopehome}" \
+  --no-compile
+make build
+popd
+
+# process the skel directory into the buildroot
+python << EOF
+import py_compile, os
+files = os.popen("find lib -name '*.py'").readlines()
+# Yo version:
+# files = os.popen("find . -name '*.py'").readlines()
+for file in files:
+    file = file.strip()
+    py_compile.compile(file, file+"o", "%{zopehome}/"+file)
+    py_compile.compile(file, file+"c", "%{zopehome}/"+file)
+EOF
+
+# XXX: next release...
+#env CFLAGS="$RPM_OPT_FLAGS" /usr/bin/python setup.py build
+#/usr/bin/python setup.py install --root=$RPM_BUILD_ROOT \
+#    --record=INSTALLED_FILES
+
+## Clean sources
+#find -type d -name "tests" | xargs rm -rf
+find lib/python -type f -and \( -name 'Setup' -or -name '.cvsignore' \) \
+    -exec rm -f \{\} \;
+#find -type f -and \( -name '*.c' -or -name '*.h' -or -name 'Makefile*' \) \
+#    -exec rm -f \{\} \;
+find -name "Win32" | xargs rm -rf
+rm -f ZServer/medusa/monitor_client_win32.py
+
+# Has a bogus #!/usr/local/bin/python1.4 that confuses RPM
+rm -f ZServer/medusa/test/asyn_http_bench.py
+
+cp %{SOURCE3} README.install.urpmi
+
+%install
+%{python} "utilities/copyzopeskel.py" \
+         --sourcedir="skel" \
+         --targetdir="%{buildroot}" \
+         --replace="INSTANCE_HOME:%{instancehome}" \
+         --replace="CLIENT_HOME:%{clienthome}" \
+         --replace="STATE_DIR:%{statehome}" \
+         --replace="LOG_DIR:%{loghome}" \
+         --replace="SOFTWARE_HOME:%{softwarehome}" \
+         --replace="ZOPE_HOME:%{zopehome}" \
+         --replace="CONFIG_FILE:%{configfile}" \
+         --replace="PYTHON:%{python}" \
+         --replace="ZOPECTL:%{zopectl}" \
+         --replace="RUNZOPE:%{runzope}"
+
+#perl -pi -e "s|data_dir\s+=\s+.*?join\(INSTANCE_HOME, 'var'\)|data_dir=INSTANCE_HOME|" lib/python/Globals.py
+
+
+pushd build
+make install
+popd
+
+#rm -rf $RPM_BUILD_ROOT
+#install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}/zope/lib/python} \
+#    $RPM_BUILD_ROOT{/etc/rc.d/init.d,/var/log,/var/lib/zope}
+#
+#cp -a lib/python/* $RPM_BUILD_ROOT%{_libdir}/zope/lib/python
+#cp -a ZServer/ utilities/ import/ $RPM_BUILD_ROOT%{_libdir}/zope
+#find $RPM_BUILD_ROOT%{_libdir}/zope -type f -name '*.py' -or -name '*.txt' \
+#    | xargs -r rm -f
+#cp -a ZServer/medusa/test/* $RPM_BUILD_ROOT%{_libdir}/zope/ZServer/medusa/test/
+#
+#install zpasswd.py $RPM_BUILD_ROOT%{_bindir}/zpasswd
+#install z2.py $RPM_BUILD_ROOT%{_libdir}/zope
+#install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}/zope-zserver
+#install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/zope
+#install var/Data.fs $RPM_BUILD_ROOT/var/lib/zope/Data.fs
+#
+#touch $RPM_BUILD_ROOT/var/log/zope
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%pre
+%_pre_useradd zope /var/lib/zope /bin/false
+
+%post
+%_post_service zope
+/sbin/chkconfig --add zope
+
+# disable this feature : it creates problem during update and
+# is confusing for somebody who don't care about installation message
+# zope display a how to create an administrative user if it doesn't exit
+# README.install.urpmi display the rest of the text
+
+# # write a 10 digit random default admin password into acl_users
+# passwd=`head -c4 /dev/urandom | od -tu4 -N4 | sed -ne '1s/.* //p'`
+# %{zopectl} adduser admin $passwd
+# # inform the user of the default username/password combo and port
+# echo
+# echo A Zope instance has been installed.  Run it via
+# echo \"/etc/rc.d/init.d/zope start\".  Log in via a browser on port 9080.
+# echo
+# echo Zope has default administrative username/password combination.  The
+# echo "administrative username is \"admin\" and the password is \"$passwd\"."
+# echo Please remember this so you are able to log in for the first time.
+# echo
+
+%preun
+%_preun_service zope
+
+%postun
+%_postun_userdel zope
+
+%files
+%defattr(0644,root,root,755)
+%dir %{zopehome}
+%{zopehome}/doc
+%{zopehome}/import
+%{zopehome}/lib
+%{zopehome}/skel
+
+%attr(755,root,root)/usr/bin/runzope
+%attr(755,root,root)/usr/bin/zopectl
+%attr(755,root,root) %{zopehome}/bin/*
+%attr(755,root,root) %config(noreplace) /etc/rc.d/init.d/zope
+%config(noreplace) /etc/zope.conf
+%config(noreplace) /etc/logrotate.d/zope
+
+%attr(770, %{zopeuser}, %{zopeuser}) %config(noreplace) %verify(not md5 size mtime) %{instancehome}
+%attr(770, %{zopeuser}, %{zopeuser}) %dir /var/log/zope
+%attr(755, %{zopeuser}, %{zopeuser}) %dir /var/run/zope
+
+%doc README.install.urpmi
+
+#%defattr(644,root,root,755)
+#%config(noreplace) %attr(755,root,root) /etc/rc.d/init.d/zope
+#%attr(755,root,root) %{_bindir}/*
+#%attr(755,root,root) %{_sbindir}/*
+#%{_libdir}/zope
+#%attr(1771,root,zope) %dir /var/lib/zope
+#%attr(660,root,zope) %config(noreplace) %verify(not md5 size mtime) /var/lib/zope/*
+##%attr(640,root,root) %ghost /var/log/zope
+#%ghost /var/log/zope
+
+
+##############################################################################
+
+%package docs
+Summary:    Documentation for the Zope application server
+Requires:   zope = %{version}
+Group:      Networking/WWW
+
+%description docs
+Documentation for the Z Object Programming Environment (Zope), a free, Open
+Source Python-based application server for building high-performance, dynamic
+web sites, using a powerful and simple scripting object model and
+high-performance, integrated object database.
+
+%files docs
+%defattr(644, root, root, 755)
+%doc ZopeBook doc
+
+
+##############################################################################
+
+%changelog
+* Wed Jan 5 2006 Kevin Deldycke <kevin at nexedi.com> 2.7.8-2nxd
+  - Rewrite spec file based on the one written by Gaetan Lehmann for the zope-2.7.7 release for Mandriva 2006
+  - Add 'erp5' prefix to package name
+  - Add README.install.urpmi.zope
+  - Remove default admin user
+
+* Fri Oct 28 2005 Yoshinori Okuji <yo at nexedi.com> 2.7.8-1nxd
+  - New upstream release
+
+* Wed Oct 12 2005 Yoshinori Okuji <yo at nexedi.com> 2.7.7b1-1nxd
+  - New upstream release
+
+* Sun Apr 24 2005 Yoshinori Okuji <yo at nexedi.com> 2.7.6b2-2nxd
+  - Rebuild against Python 2.4
+
+* Thu Apr 21 2005 Yoshinori Okuji <yo at nexedi.com> 2.7.6b2-1nxd
+  - Bump to Zope 2.7.6b2
+
+* Thu Feb 3 2005 Yoshinori Okuji <yo at nexedi.com> 2.7.2rc1-3nxd
+  - The source tarball was not bzip2'ed even though the suffix was bz2
+
+* Tue Feb 1 2005 Yoshinori Okuji <yo at nexedi.com> 2.7.2rc1-2nxd
+  - Fix the method bounding in _aq_dynamic
+
+* Mon Aug 2 2004 Yoshinori Okuji <yo at nexedi.com> 2.7.2rc1-1nxd
+  - Bump to 2.7.2rc1
+  - Patch Acquistion to support _aq_dynamic
+
+* Sat Feb 07 2004 Stéfane Fermigier <sf at nuxeo.com> 2.7.0rc2-1mdk
+  - Bump to Zope 2.7.0rc2
+
+* Sun Jan 11 2004 Stéfane Fermigier <sf at nuxeo.com> 2.7.0b4-1mdk
+  - Bump to Zope 2.7.0b4
+
+* Sun Sep 14 2003 Stéfane Fermigier <sf at nuxeo.com> 2.7.0b2-1pyp
+  - Update to Zope 2.7.0b2
+
+* Fri Aug 15 2003 Stéfane Fermigier <sf at nuxeo.com> 2.7.0b1-3pyp
+  - Update for Python 2.3
+
+* Sat Aug 9 2003 Stéfane Fermigier <sf at nuxeo.com> 2.7.0b1-2pyp
+  - Added copyright notice
+  - Compile to .pyc as well as to .pyo
+
+* Sat Jul 26 2003 Stéfane Fermigier <sf at nuxeo.com> 2.7.0b1-1mdk
+  - Update to Zope 2.7.0b1
+  - Merged stuff from the Zope.org RPM
+
+* Sat May 3 2003 Stéfane Fermigier <sf at nuxeo.com> 2.6.1-6mdk
+  - Moved python stuff from /usr/lib/zope to /usr/lib/zope/lib/python
+
+* Mon Mar 24 2003 Stéfane Fermigier <sf at nuxeo.com> 2.6.1-5mdk
+  - Moved python stuff from /usr/lib/zope to /usr/lib/zope/lib/python
+
+* Tue Feb 25 2003 Stéfane Fermigier <sf at nuxeo.com> 2.6.1-4mdk
+  - changes by Frederic Lepied
+  - fixed dependency problem between zope-docs and zope
+  - removed unused directive
+
+* Sun Feb 23 2003 Stéfane Fermigier <sf at nuxeo.com> 2.6.1-3mdk
+  - fix bugs
+
+* Sat Feb 22 2003 Stéfane Fermigier <sf at nuxeo.com> 2.6.1-2mdk
+  - dont ship tests
+  - separate docs package, including the Zope Book.
+
+* Sat Feb 22 2003 Stéfane Fermigier <sf at nuxeo.com> 2.6.1-1mdk
+  First release starting from PLD RPM.

Propchange: spec/mandriva/2006.0/erp5-zope/erp5-zope.spec
------------------------------------------------------------------------------
    svn:executable = *




More information about the Erp5-report mailing list