3ae8364b1d12306705c6523fc1d9f8e74161ed48
[fedora-mingw.git] / python / python-2.5.1-db47.patch
1 diff -up Python-2.5.1/Modules/_bsddb.c.db46 Python-2.5.1/Modules/_bsddb.c
2 --- Python-2.5.1/Modules/_bsddb.c.db46  2007-01-04 21:09:06.000000000 -0500
3 +++ Python-2.5.1/Modules/_bsddb.c       2008-07-10 09:58:55.000000000 -0400
4 @@ -5306,11 +5306,13 @@ static PyObject*
5  DBEnv_getattr(DBEnvObject* self, char *name)
6  {
7      if (!strcmp(name, "db_home")) {
8 +       const char *home = NULL;
9          CHECK_ENV_NOT_CLOSED(self);
10 -        if (self->db_env->db_home == NULL) {
11 +       self->db_env->get_home(self->db_env, &home);
12 +        if (home == NULL) {
13              RETURN_NONE();
14          }
15 -        return PyString_FromString(self->db_env->db_home);
16 +        return PyString_FromString(home);
17      }
18  
19      return Py_FindMethod(DBEnv_methods, (PyObject* )self, name);
20 @@ -5932,22 +5934,37 @@ DL_EXPORT(void) init_bsddb(void)
21      ADD_INT(d, DB_TIME_NOTGRANTED);
22      ADD_INT(d, DB_TXN_NOT_DURABLE);
23      ADD_INT(d, DB_TXN_WRITE_NOSYNC);
24 -    ADD_INT(d, DB_LOG_AUTOREMOVE);
25 -    ADD_INT(d, DB_DIRECT_LOG);
26      ADD_INT(d, DB_DIRECT_DB);
27      ADD_INT(d, DB_INIT_REP);
28      ADD_INT(d, DB_ENCRYPT);
29      ADD_INT(d, DB_CHKSUM);
30  #endif
31  
32 +#if (DBVER >= 42) && (DBVER < 47)
33 +    ADD_INT(d, DB_LOG_AUTOREMOVE);
34 +    ADD_INT(d, DB_DIRECT_LOG);
35 +#endif
36 +
37 +#if (DBVER >= 47)
38 +    ADD_INT(d, DB_LOG_DIRECT);
39 +    ADD_INT(d, DB_LOG_DSYNC);
40 +    ADD_INT(d, DB_LOG_IN_MEMORY);
41 +    ADD_INT(d, DB_LOG_AUTO_REMOVE);
42 +    ADD_INT(d, DB_LOG_ZERO);
43 +#endif
44 +
45  #if (DBVER >= 43)
46 -    ADD_INT(d, DB_LOG_INMEMORY);
47      ADD_INT(d, DB_BUFFER_SMALL);
48      ADD_INT(d, DB_SEQ_DEC);
49      ADD_INT(d, DB_SEQ_INC);
50      ADD_INT(d, DB_SEQ_WRAP);
51  #endif
52  
53 +#if (DBVER >= 43) && (DBVER < 47)
54 +    ADD_INT(d, DB_LOG_INMEMORY);
55 +    ADD_INT(d, DB_DSYNC_LOG);
56 +#endif
57 +
58  #if (DBVER >= 41)
59      ADD_INT(d, DB_ENCRYPT_AES);
60      ADD_INT(d, DB_AUTO_COMMIT);
61 diff -up Python-2.5.1/setup.py.db46 Python-2.5.1/setup.py
62 --- Python-2.5.1/setup.py.db46  2008-07-10 09:55:08.000000000 -0400
63 +++ Python-2.5.1/setup.py       2008-07-10 09:55:08.000000000 -0400
64 @@ -606,9 +606,9 @@ class PyBuildExt(build_ext):
65          # a release.  Most open source OSes come with one or more
66          # versions of BerkeleyDB already installed.
67  
68 -        max_db_ver = (4, 5)
69 +        max_db_ver = (4, 7)
70          min_db_ver = (3, 3)
71 -        db_setup_debug = False   # verbose debug prints from this script?
72 +        db_setup_debug = True    # verbose debug prints from this script?
73  
74          # construct a list of paths to look for the header file in on
75          # top of the normal inc_dirs.
76 @@ -623,7 +623,7 @@ class PyBuildExt(build_ext):
77              '/sw/include/db3',
78          ]
79          # 4.x minor number specific paths
80 -        for x in (0,1,2,3,4,5):
81 +        for x in (0,1,2,3,4,5,6,7):
82              db_inc_paths.append('/usr/include/db4%d' % x)
83              db_inc_paths.append('/usr/include/db4.%d' % x)
84              db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
85 @@ -646,7 +646,7 @@ class PyBuildExt(build_ext):
86          for dn in inc_dirs:
87              std_variants.append(os.path.join(dn, 'db3'))
88              std_variants.append(os.path.join(dn, 'db4'))
89 -            for x in (0,1,2,3,4):
90 +            for x in (0,1,2,3,4,5,6,7):
91                  std_variants.append(os.path.join(dn, "db4%d"%x))
92                  std_variants.append(os.path.join(dn, "db4.%d"%x))
93              for x in (2,3):