diff options
author | drochner <drochner@pkgsrc.org> | 2002-02-05 21:05:58 +0000 |
---|---|---|
committer | drochner <drochner@pkgsrc.org> | 2002-02-05 21:05:58 +0000 |
commit | 92ec416ee7dc6aaa22df771e7151e963a0a1749a (patch) | |
tree | 1aad700dbd543c3e3eee24fa3834ab457ba0a3c2 /www/ap-python/patches | |
parent | 1096803107fad5d3e3986ac28a7251889984fda8 (diff) | |
download | pkgsrc-92ec416ee7dc6aaa22df771e7151e963a0a1749a.tar.gz |
ap-mod_python->ap-python
Diffstat (limited to 'www/ap-python/patches')
-rw-r--r-- | www/ap-python/patches/patch-aa | 12 | ||||
-rw-r--r-- | www/ap-python/patches/patch-ab | 124 | ||||
-rw-r--r-- | www/ap-python/patches/patch-ac | 18 | ||||
-rw-r--r-- | www/ap-python/patches/patch-ad | 14 |
4 files changed, 168 insertions, 0 deletions
diff --git a/www/ap-python/patches/patch-aa b/www/ap-python/patches/patch-aa new file mode 100644 index 00000000000..4b85c0846a0 --- /dev/null +++ b/www/ap-python/patches/patch-aa @@ -0,0 +1,12 @@ +$NetBSD: patch-aa,v 1.1.1.1 2002/02/05 21:05:58 drochner Exp $ +--- src/Makefile.in.orig Sat Nov 10 05:38:09 2001 ++++ src/Makefile.in Sat Nov 10 05:38:39 2001 +@@ -53,7 +53,7 @@ + INCLUDES=@INCLUDES@ + LIBS=@LIBS@ + LDFLAGS=@LDFLAGS@ +-OPT= ++OPT=-DEAPI + CFLAGS=$(OPT) $(INCLUDES) + srcdir=. + diff --git a/www/ap-python/patches/patch-ab b/www/ap-python/patches/patch-ab new file mode 100644 index 00000000000..ad8ffee972c --- /dev/null +++ b/www/ap-python/patches/patch-ab @@ -0,0 +1,124 @@ +$NetBSD: patch-ab,v 1.1.1.1 2002/02/05 21:05:58 drochner Exp $ +--- src/tableobject.c.orig Mon May 28 23:00:41 2001 ++++ src/tableobject.c Sun Nov 4 18:28:55 2001 +@@ -185,6 +185,105 @@ + }; + + /** ++ ** table_get ++ ** ++ * ++ * Implements dictionary like get(k,[x]) method. ++ */ ++ ++static PyObject * table_get(tableobject *self, PyObject *args) ++{ ++ ++ PyObject *key,*v; ++ PyObject *failob = Py_None; ++ array_header *ah; ++ table_entry *elts; ++ int i, j; ++ ++ if(!PyArg_ParseTuple(args, "O|O:get", &key, &failob)) ++ return NULL; ++ v=tablegetitem(self,key); ++ if(v = NULL) { ++ v=failob; ++ Py_INCREF(failob); ++ } ++ return v; ++} ++ ++/** ++ ** table_keys ++ ** ++ * ++ * Implements dictionary like items() method. ++ */ ++ ++static PyObject * table_items(tableobject *self) ++{ ++ ++ PyObject *v; ++ array_header *ah; ++ table_entry *elts; ++ int i, j; ++ ++ ah = ap_table_elts(self->table); ++ elts = (table_entry *) ah->elts; ++ ++ v = PyList_New(ah->nelts); ++ ++ for (i = 0, j = 0; i < ah->nelts; i++) ++ { ++ if (elts[i].key) ++ { ++ PyObject *vp = PyTuple_New(2); ++ if(vp == NULL) { ++ Py_DECREF(v); ++ return NULL; ++ } ++ PyTuple_SET_ITEM(vp,0,PyString_FromString(elts[i].key)); ++ PyTuple_SET_ITEM(vp,1,PyString_FromString(ap_table_get(self->table, ++ elts[i].key))); ++ PyList_SetItem(v, j, vp); ++ j++; ++ } ++ } ++ return v; ++} ++/** ++ ** table_keys ++ ** ++ * ++ * Implements dictionary like values() method. ++ * This mostly for completeness sake, I can't see use for it ++ */ ++ ++static PyObject * table_values(tableobject *self) ++{ ++ ++ PyObject *v; ++ array_header *ah; ++ table_entry *elts; ++ int i, j; ++ ++ ah = ap_table_elts(self->table); ++ elts = (table_entry *) ah->elts; ++ ++ v = PyList_New(ah->nelts); ++ ++ for (i = 0, j = 0; i < ah->nelts; i++) ++ { ++ if (elts[i].key) ++ { ++ PyObject *val = PyString_FromString(ap_table_get(self->table, ++ elts[i].key)); ++ PyList_SetItem(v, j, val); ++ j++; ++ } ++ } ++ return v; ++} ++ ++ ++/** + ** table_keys + ** + * +@@ -261,9 +360,13 @@ + /* table method definitions */ + + static PyMethodDef tablemethods[] = { +- {"keys", (PyCFunction)table_keys, METH_VARARGS}, + {"has_key", (PyCFunction)table_has_key, METH_VARARGS}, + {"add", (PyCFunction)mp_table_add, METH_VARARGS}, ++ {"items", (PyCFunction)table_items, METH_VARARGS}, ++ {"keys", (PyCFunction)table_keys, METH_VARARGS}, ++ {"get", (PyCFunction)table_get, METH_VARARGS}, ++ {"values", (PyCFunction)table_values, METH_VARARGS}, ++ /* Still needs: copy, update, clear, setdefault, popitem */ + {NULL, NULL} /* sentinel */ + }; + diff --git a/www/ap-python/patches/patch-ac b/www/ap-python/patches/patch-ac new file mode 100644 index 00000000000..a0c037111db --- /dev/null +++ b/www/ap-python/patches/patch-ac @@ -0,0 +1,18 @@ +$NetBSD: patch-ac,v 1.1.1.1 2002/02/05 21:05:58 drochner Exp $ +--- src/mod_python.c.orig Sat Nov 10 13:06:57 2001 ++++ src/mod_python.c Sat Nov 10 13:07:53 2001 +@@ -474,11 +474,13 @@ + + if (! ((m = PyImport_ImportModule(MODULENAME)))) { + fprintf(stderr, "make_obcallback(): could not import %s.\n", MODULENAME); ++ PyErr_Print(); + } + +- if (! ((obCallBack = PyObject_CallMethod(m, INITFUNC, NULL)))) { ++ if (m && ! ((obCallBack = PyObject_CallMethod(m, INITFUNC, NULL)))) { + fprintf(stderr, "make_obcallback(): could not call %s.\n", + INITFUNC); ++ PyErr_Print(); + } + + return obCallBack; diff --git a/www/ap-python/patches/patch-ad b/www/ap-python/patches/patch-ad new file mode 100644 index 00000000000..559a4ff7b67 --- /dev/null +++ b/www/ap-python/patches/patch-ad @@ -0,0 +1,14 @@ +$NetBSD: patch-ad,v 1.1.1.1 2002/02/05 21:05:58 drochner Exp $ + +--- Makefile.in.orig Wed Dec 6 04:05:37 2000 ++++ Makefile.in Tue Feb 5 21:30:44 2002 +@@ -119,7 +119,8 @@ + do \ + $(INSTALL) $$f $(PY_STD_LIB)/site-packages/mod_python; \ + done +- python $(PY_STD_LIB)/compileall.py $(PY_STD_LIB)/site-packages/mod_python ++ ${PYTHONBIN} $(PY_STD_LIB)/compileall.py $(PY_STD_LIB)/site-packages/mod_python ++ ${PYTHONBIN} -O $(PY_STD_LIB)/compileall.py $(PY_STD_LIB)/site-packages/mod_python + + clean: + cd src && $(MAKE) clean |