]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-db4.patch
- rediffed, do not remove db-3.2
[packages/rpm.git] / rpm-db4.patch
1 diff -Nur rpm-4.1.orig/configure.ac rpm-4.1/configure.ac
2 --- rpm-4.1.orig/configure.ac   Sun Oct 20 16:34:30 2002
3 +++ rpm-4.1/configure.ac        Sun Oct 20 16:37:39 2002
4 @@ -437,10 +437,12 @@
5  if test $withval = no ; then
6  dnl ------------------ without internal db
7  
8 -AC_CHECK_HEADERS(db3/db.h)
9 +AC_CHECK_HEADERS(db.h)
10  
11  dnl Check for Berkeley db3 API.
12  AC_CHECK_FUNC(db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"],
13 +  AC_CHECK_LIB(db-4.1, db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb-4.1"],
14 +  AC_CHECK_LIB(db-4.0, db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb-4.0"],
15    AC_CHECK_LIB(db-3.2, db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb-3.2"],
16      AC_CHECK_LIB(db-3.1, db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb-3.1"],
17        AC_CHECK_LIB(db-3.0, db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb-3.0"],
18 @@ -449,6 +451,8 @@
19        )
20      )
21    )
22 +  )
23 +  )
24  )
25  
26  if test X"$DBLIBSRCS" = X; then
27 diff -Nur rpm-4.1.orig/python/_rpmdb.c rpm-4.1/python/_rpmdb.c
28 --- rpm-4.1.orig/python/_rpmdb.c        Fri Jun  7 15:12:34 2002
29 +++ rpm-4.1/python/_rpmdb.c     Sun Oct 20 16:36:39 2002
30 @@ -410,25 +410,6 @@
31      switch (err) {
32          case 0:                     /* successful, no error */      break;
33  
34 -        case DB_INCOMPLETE:
35 -#if INCOMPLETE_IS_WARNING
36 -            strcpy(errTxt, db_strerror(err));
37 -            if (_db_errmsg[0]) {
38 -                strcat(errTxt, " -- ");
39 -                strcat(errTxt, _db_errmsg);
40 -                _db_errmsg[0] = 0;
41 -            }
42 -#if PYTHON_API_VERSION >= 1010 /* if Python 2.1 or better use warning framework */
43 -            exceptionRaised = PyErr_Warn(PyExc_RuntimeWarning, errTxt);
44 -#else
45 -            fprintf(stderr, errTxt);
46 -            fprintf(stderr, "\n");
47 -#endif
48 -
49 -#else  /* do an exception instead */
50 -        errObj = DBIncompleteError;
51 -#endif
52 -        break;
53  
54          case DB_KEYEMPTY:           errObj = DBKeyEmptyError;       break;
55          case DB_KEYEXIST:           errObj = DBKeyExistError;       break;
56 @@ -1025,7 +1006,7 @@
57  
58  
59      MYDB_BEGIN_ALLOW_THREADS;
60 -    err = self->db->associate(self->db,
61 +    err = self->db->associate(self->db, NULL,
62                                secondaryDB->db,
63                                _db_associateCallback,
64                                flags);
65 @@ -1498,7 +1479,7 @@
66      }
67  
68      MYDB_BEGIN_ALLOW_THREADS;
69 -    err = self->db->open(self->db, filename, dbname, type, flags, mode);
70 +    err = self->db->open(self->db, NULL, filename, dbname, type, flags, mode);
71      MYDB_END_ALLOW_THREADS;
72      if (makeDBError(err)) {
73          self->db = NULL;
74 @@ -1851,7 +1832,6 @@
75          MAKE_HASH_ENTRY(nkeys);
76          MAKE_HASH_ENTRY(ndata);
77          MAKE_HASH_ENTRY(pagesize);
78 -        MAKE_HASH_ENTRY(nelem);
79          MAKE_HASH_ENTRY(ffactor);
80          MAKE_HASH_ENTRY(buckets);
81          MAKE_HASH_ENTRY(free);
82 @@ -3337,7 +3317,6 @@
83  
84  #define MAKE_ENTRY(name)  _addIntToDict(d, #name, sp->st_##name)
85  
86 -    MAKE_ENTRY(lastid);
87      MAKE_ENTRY(nmodes);
88  #if (DBVER >= 32)
89      MAKE_ENTRY(maxlocks);
90 @@ -4116,7 +4095,6 @@
91      ADD_INT(d, DB_APPEND);
92      ADD_INT(d, DB_BEFORE);
93      ADD_INT(d, DB_CACHED_COUNTS);
94 -    ADD_INT(d, DB_CHECKPOINT);
95  #if (DBVER >= 33)
96      ADD_INT(d, DB_COMMIT);
97  #endif
98 @@ -4124,7 +4102,6 @@
99  #if (DBVER >= 32)
100      ADD_INT(d, DB_CONSUME_WAIT);
101  #endif
102 -    ADD_INT(d, DB_CURLSN);
103      ADD_INT(d, DB_CURRENT);
104  #if (DBVER >= 33)
105      ADD_INT(d, DB_FAST_STAT);
106 @@ -4164,7 +4141,6 @@
107      ADD_INT(d, DB_DONOTINDEX);
108  #endif
109  
110 -    ADD_INT(d, DB_INCOMPLETE);
111      ADD_INT(d, DB_KEYEMPTY);
112      ADD_INT(d, DB_KEYEXIST);
113      ADD_INT(d, DB_LOCK_DEADLOCK);
114 diff -Nur rpm-4.1.orig/rpmdb/db3.c rpm-4.1/rpmdb/db3.c
115 --- rpm-4.1.orig/rpmdb/db3.c    Tue Aug 13 22:42:39 2002
116 +++ rpm-4.1/rpmdb/db3.c Sun Oct 20 16:36:39 2002
117 @@ -366,7 +366,7 @@
118      if (db != NULL)
119         rc = db->sync(db, flags);
120      /* XXX DB_INCOMPLETE is returned occaisionally with multiple access. */
121 -    _printit = (rc == DB_INCOMPLETE ? 0 : _debug);
122 +    _printit = _debug;
123      rc = cvtdberr(dbi, "db->sync", rc, _printit);
124      return rc;
125  }
126 @@ -599,10 +599,11 @@
127  {
128      DB * db = dbi->dbi_db;
129      DB * secondary = dbisecondary->dbi_db;
130 +    DB_TXN * txnid = NULL;
131      int rc;
132  
133  /*@-moduncon@*/ /* FIX: annotate db3 methods */
134 -    rc = db->associate(db, secondary, callback, flags);
135 +    rc = db->associate(db, txnid, secondary, callback, flags);
136  /*@=moduncon@*/
137      rc = cvtdberr(dbi, "db->associate", rc, _debug);
138      return rc;
139 @@ -789,6 +790,7 @@
140  
141      DB * db = NULL;
142      DB_ENV * dbenv = NULL;
143 +    DB_TXN * txnid = NULL;
144      u_int32_t oflags;
145      int _printit;
146  
147 @@ -1124,7 +1126,7 @@
148                         ? dbfullpath : dbfile;
149  #endif
150  
151 -               rc = db->open(db, dbpath, dbsubfile,
152 +               rc = db->open(db, txnid, dbpath, dbsubfile,
153                     dbi->dbi_type, oflags, dbi->dbi_perms);
154  
155                 if (rc == 0 && dbi->dbi_type == DB_UNKNOWN) {
This page took 0.082103 seconds and 4 git commands to generate.