updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / python26 / python-2.6-db-4.8.patch
blob2032f924c4bd0eb8f4715df3f6751419717a26a3
1 Index: setup.py
2 ===================================================================
3 --- setup.py (revision 74955)
4 +++ setup.py (working copy)
5 @@ -695,7 +695,7 @@
6 # a release. Most open source OSes come with one or more
7 # versions of BerkeleyDB already installed.
9 - max_db_ver = (4, 7)
10 + max_db_ver = (4, 8)
11 min_db_ver = (3, 3)
12 db_setup_debug = False # verbose debug prints from this script?
14 Index: Modules/_bsddb.c
15 ===================================================================
16 --- Modules/_bsddb.c (revision 74955)
17 +++ Modules/_bsddb.c (working copy)
18 @@ -215,7 +215,11 @@
19 #define DB_BUFFER_SMALL ENOMEM
20 #endif
22 +#if (DBVER < 48)
23 +#define DB_GID_SIZE DB_XIDDATASIZE
24 +#endif
27 /* --------------------------------------------------------------------- */
28 /* Structure definitions */
30 @@ -4501,7 +4505,11 @@
31 DBTxnObject *txn;
32 #define PREPLIST_LEN 16
33 DB_PREPLIST preplist[PREPLIST_LEN];
34 +#if (DBVER < 48)
35 long retp;
36 +#else
37 + u_int32_t retp;
38 +#endif
40 CHECK_ENV_NOT_CLOSED(self);
42 @@ -4522,7 +4530,7 @@
43 flags=DB_NEXT; /* Prepare for next loop pass */
44 for (i=0; i<retp; i++) {
45 gid=PyBytes_FromStringAndSize((char *)(preplist[i].gid),
46 - DB_XIDDATASIZE);
47 + DB_GID_SIZE);
48 if (!gid) {
49 Py_DECREF(list);
50 return NULL;
51 @@ -5047,6 +5055,7 @@
55 +#if (DBVER < 48)
56 static PyObject*
57 DBEnv_set_rpc_server(DBEnvObject* self, PyObject* args, PyObject* kwargs)
59 @@ -5068,6 +5077,7 @@
60 RETURN_IF_ERR();
61 RETURN_NONE();
63 +#endif
65 static PyObject*
66 DBEnv_set_verbose(DBEnvObject* self, PyObject* args)
67 @@ -5947,9 +5957,9 @@
68 if (!PyArg_ParseTuple(args, "s#:prepare", &gid, &gid_size))
69 return NULL;
71 - if (gid_size != DB_XIDDATASIZE) {
72 + if (gid_size != DB_GID_SIZE) {
73 PyErr_SetString(PyExc_TypeError,
74 - "gid must be DB_XIDDATASIZE bytes long");
75 + "gid must be DB_GID_SIZE bytes long");
76 return NULL;
79 @@ -6539,8 +6549,10 @@
80 #endif
81 {"set_get_returns_none",(PyCFunction)DBEnv_set_get_returns_none, METH_VARARGS},
82 {"txn_recover", (PyCFunction)DBEnv_txn_recover, METH_NOARGS},
83 +#if (DBVER < 48)
84 {"set_rpc_server", (PyCFunction)DBEnv_set_rpc_server,
85 METH_VARARGS||METH_KEYWORDS},
86 +#endif
87 {"set_verbose", (PyCFunction)DBEnv_set_verbose, METH_VARARGS},
88 #if (DBVER >= 42)
89 {"get_verbose", (PyCFunction)DBEnv_get_verbose, METH_VARARGS},
90 @@ -7089,6 +7101,7 @@
91 ADD_INT(d, DB_MAX_PAGES);
92 ADD_INT(d, DB_MAX_RECORDS);
94 +#if (DBVER < 48)
95 #if (DBVER >= 42)
96 ADD_INT(d, DB_RPCCLIENT);
97 #else
98 @@ -7096,7 +7109,11 @@
99 /* allow apps to be written using DB_RPCCLIENT on older Berkeley DB */
100 _addIntToDict(d, "DB_RPCCLIENT", DB_CLIENT);
101 #endif
102 +#endif
104 +#if (DBVER < 48)
105 ADD_INT(d, DB_XA_CREATE);
106 +#endif
108 ADD_INT(d, DB_CREATE);
109 ADD_INT(d, DB_NOMMAP);
110 @@ -7113,7 +7130,13 @@
111 ADD_INT(d, DB_INIT_TXN);
112 ADD_INT(d, DB_JOINENV);
114 +#if (DBVER >= 48)
115 + ADD_INT(d, DB_GID_SIZE);
116 +#else
117 ADD_INT(d, DB_XIDDATASIZE);
118 + /* Allow new code to work in old BDB releases */
119 + _addIntToDict(d, "DB_GID_SIZE", DB_XIDDATASIZE);
120 +#endif
122 ADD_INT(d, DB_RECOVER);
123 ADD_INT(d, DB_RECOVER_FATAL);