the Fink project is an effort to port
popular Unix programs to Mac OS X
Package: db44
Version: 4.4.20
Revision: 1009
CustomMirror: <<
nam-US: http://download-east.oracle.com/berkeley-db/
nam-US: http://download-west.oracle.com/berkeley-db/
eur-UK: http://download-uk.oracle.com/berkeley-db/
<<
Source: mirror:custom:db-%v.NC.tar.gz
Replaces: <<
db, db3, db31 (<< 3.1.17-8),
db4-ssl, db4,
db41-ssl, db41,
db42-ssl, db42,
db43-ssl, db43,
db44-aes, db44,
db47-aes, db47, db47-aes-64bit, db47-64bit,
db48-aes, db48, db48-aes-64bit, db48-64bit,
db50-aes, db50, db50-aes-64bit, db50-64bit,
db51-aes, db51, db51-aes-64bit, db51-64bit,
db53-aes, db53-aes-64bit
<<
Conflicts: <<
db, db3, db31 (<< 3.1.17-8),
db4-ssl, db4,
db41-ssl, db41,
db42-ssl, db42,
db43-ssl, db43,
db44-aes, db44,
db47-aes, db47, db47-aes-64bit, db47-64bit,
db48-aes, db48, db48-aes-64bit, db48-64bit,
db50-aes, db50, db50-aes-64bit, db50-64bit,
db51-aes, db51, db51-aes-64bit, db51-64bit,
db53-aes, db53-aes-64bit
<<
Depends: db44-shlibs (= %v-%r) | db44-aes-shlibs (=%v-%r)
BuildDepends: fink (>= 0.26.2)
BuildDependsOnly: true
NoSetLDFlags: true
NoSetCPPFlags: true
SetCFlags: -Os
SetCXXFlags: -Os
PatchFile: %{ni}.patch
PatchFile-MD5: c1d1b6777485d661bac5cf76bf8b9d4a
ConfigureParams: --enable-compat185 --enable-cxx --enable-dump185 --includedir=%p/include/db4
GCC: 4.0
CompileScript: <<
#! /bin/sh -ex
set +x
if [ -e /usr/local/include/db.h ]; then
echo "-----WARNING-----WARNING-----WARNING-----"
echo "You seem to have a Berkeley DB installation in /usr/local."
echo "This is known to cause %N to fail to build."
echo "Please rename /usr/local/include/db.h temporarily and try again."
echo "-----WARNING-----WARNING-----WARNING-----"
exit 1
fi
set -x
VERSIONS="-avoid-version -XCClinker -current_version -XCClinker %v -XCClinker -compatibility_version -XCClinker 4.4 -no-undefined"
LIBDB="libdb-4.4.la"
LIBDBCXX="libdb_cxx-4.4.la"
cd build_unix;
F77=no ../dist/configure %c
perl -pi.bak -e 's,api_java,,g' Makefile
make UTIL_PROGS=""
rm ".libs/$LIBDB" $LIBDB
make SOLINK="\$(LIBTOOL) --mode=link --tag=CC gcc $VERSIONS" UTIL_PROGS=""
rm ".libs/$LIBDBCXX" $LIBDBCXX
make XSOLINK="\$(LIBTOOL) --mode=link --tag=CXX g++ $VERSIONS" UTIL_PROGS=""
make
<<
InstallScript: <<
#! /bin/sh -ev
(cd build_unix; make install prefix=%I docdir=%I/share/doc/db44-doc/docs includedir=%I/include/db4) || exit 1
binfiles="db_archive db_checkpoint db_deadlock db_dump db_dump185 db_hotbackup db_load db_printlog db_recover db_stat db_upgrade db_verify"
for binfile in $binfiles ; do
mv %i/bin/$binfile %i/bin/$binfile.%N
done
<<
SplitOff: <<
Package: %N-shlibs
Replaces: db44-aes-shlibs
Conflicts: db44-aes-shlibs
Description: Shared Libraries for db44
Files: lib/libdb-4.4.dylib lib/libdb_cxx-4.4.dylib lib/libdb-4.4.la lib/libdb_cxx-4.4.la
Shlibs: <<
%p/lib/libdb-4.4.dylib 4.4.0 %n (>= 4.4.16-1)
%p/lib/libdb_cxx-4.4.dylib 4.4.0 %n (>= 4.4.16-1)
<<
DocFiles: LICENSE
<<
SplitOff2: <<
Package: %N-bin
Depends: %N-shlibs (= %v-%r)
Conflicts: db3-bin (<< 3.3.11-25), db31 (<< 3.1.17-2), db4-ssl-bin (<< 4.0.14-24), db4-bin (<< 4.0.14-24), db41-ssl-bin (<< 4.1.25-20), db42-ssl-bin (<< 4.2.52-14), db41-bin (<< 4.1.25-20), db42-bin (<< 4.2.52-14), db43-ssl-bin
Replaces: db3-bin, db4 (<< 4.0.14-4), db31 (<< 3.1.17-2), db4-ssl-bin (<< 4.0.14-24), db4-bin (<< 4.0.14-24), db41-ssl-bin (<< 4.1.25-20), db42-ssl-bin (<< 4.2.52-14), db41-bin (<< 4.1.25-20), db42-bin (<< 4.2.52-14), db43-ssl-bin
Description: Binary utilities for db44
Files: bin
DocFiles: LICENSE
PostInstScript: <<
binfiles="db_archive db_checkpoint db_deadlock db_dump db_dump185 db_hotbackup db_load db_printlog db_recover db_stat db_upgrade db_verify"
priority=`echo %N | sed -e 's/[^0-9]//g'`
for binfile in $binfiles ; do
update-alternatives --install %p/bin/$binfile $binfile %p/bin/$binfile.%N $priority
done
<<
PreRmScript: <<
if [ $1 != "upgrade" ]; then
binfiles="db_archive db_checkpoint db_deadlock db_dump db_dump185 db_hotbackup db_load db_printlog db_recover db_stat db_upgrade db_verify"
for binfile in $binfiles ; do
update-alternatives --remove $binfile %p/bin/$binfile.%N
done
fi
<<
<<
SplitOff3: <<
Package: %N-doc
Description: Documentation for db44
Files: share/doc/db44-doc
DocFiles: LICENSE
<<
DocFiles: LICENSE README
License: OSI-Approved
Description: Berkeley DB embedded database - non crypto
Homepage: http://www.oracle.com/database/berkeley-db/index.html
Maintainer: None
Source-MD5: afd9243ea353bbaa04421488d3b37900
diff -ru db-4.4.20.orig/db/db_cam.c db-4.4.20/db/db_cam.c
--- db-4.4.20.orig/db/db_cam.c 2006-01-10 11:19:21.000000000 -0500
+++ db-4.4.20/db/db_cam.c 2009-05-08 11:16:24.000000000 -0400
@@ -579,11 +579,12 @@
flags == DB_NEXT || flags == DB_NEXT_DUP || flags == DB_PREV)) {
if (tmp_rmw && (ret = dbc_arg->c_am_writelock(dbc_arg)) != 0)
return (ret);
- if ((ret = __db_c_idup(cp->opd, &opd, DB_POSITION)) != 0)
+ if (F_ISSET(dbc_arg, DBC_TRANSIENT))
+ opd = cp->opd;
+ else if ((ret = __db_c_idup(cp->opd, &opd, DB_POSITION)) != 0)
return (ret);
- switch (ret =
- opd->c_am_get(opd, key, data, flags, NULL)) {
+ switch (ret = opd->c_am_get(opd, key, data, flags, NULL)) {
case 0:
goto done;
case DB_NOTFOUND:
@@ -596,12 +597,18 @@
if ((ret = __db_c_close(opd)) != 0)
goto err;
opd = NULL;
+ if (F_ISSET(dbc_arg, DBC_TRANSIENT))
+ cp->opd = NULL;
break;
}
goto err;
default:
goto err;
}
+ } else if (cp->opd != NULL && F_ISSET(dbc_arg, DBC_TRANSIENT)) {
+ if ((ret = __db_c_close(cp->opd)) != 0)
+ goto err;
+ cp->opd = NULL;
}
/*
diff -ru db-4.4.20.orig/mp/mp_fget.c db-4.4.20/mp/mp_fget.c
--- db-4.4.20.orig/mp/mp_fget.c 2005-10-12 13:53:36.000000000 -0400
+++ db-4.4.20/mp/mp_fget.c 2009-05-08 11:16:29.000000000 -0400
@@ -587,8 +587,11 @@
*/
if (state != SECOND_MISS && bhp->ref == 1) {
bhp->priority = UINT32_MAX;
- SH_TAILQ_REMOVE(&hp->hash_bucket, bhp, hq, __bh);
- SH_TAILQ_INSERT_TAIL(&hp->hash_bucket, bhp, hq);
+ if (SH_TAILQ_FIRST(&hp->hash_bucket, __bh) !=
+ SH_TAILQ_LAST(&hp->hash_bucket, hq, __bh)) {
+ SH_TAILQ_REMOVE(&hp->hash_bucket, bhp, hq, __bh);
+ SH_TAILQ_INSERT_TAIL(&hp->hash_bucket, bhp, hq);
+ }
hp->hash_priority =
SH_TAILQ_FIRSTP(&hp->hash_bucket, __bh)->priority;
}
diff -ru db-4.4.20.orig/qam/qam_files.c db-4.4.20/qam/qam_files.c
--- db-4.4.20.orig/qam/qam_files.c 2005-10-20 14:57:12.000000000 -0400
+++ db-4.4.20/qam/qam_files.c 2009-05-08 11:16:13.000000000 -0400
@@ -411,6 +411,12 @@
DB_APP_DATA, buf, 0, NULL, &real_name)) != 0)
goto err;
#endif
+
+ mpf = array->mpfarray[offset].mpf;
+ /* This extent my already be marked for delete and closed. */
+ if (mpf == NULL)
+ goto err;
+
/*
* The log must be flushed before the file is deleted. We depend on
* the log record of the last delete to recreate the file if we crash.
@@ -418,7 +424,6 @@
if (LOGGING_ON(dbenv) && (ret = __log_flush(dbenv, NULL)) != 0)
goto err;
- mpf = array->mpfarray[offset].mpf;
(void)__memp_set_flags(mpf, DB_MPOOL_UNLINK, 1);
/* Someone could be real slow, let them close it down. */
if (array->mpfarray[offset].pinref != 0)
diff -ru db-4.4.20.orig/txn/txn.c db-4.4.20/txn/txn.c
--- db-4.4.20.orig/txn/txn.c 2005-11-01 09:50:03.000000000 -0500
+++ db-4.4.20/txn/txn.c 2009-05-08 11:16:20.000000000 -0400
@@ -1049,12 +1049,14 @@
return (ret);
memcpy(txn->name, name, len);
+ TXN_SYSTEM_LOCK(dbenv);
if (td->name != INVALID_ROFF) {
__db_shalloc_free(
&mgr->reginfo, R_ADDR(&mgr->reginfo, td->name));
td->name = INVALID_ROFF;
}
if ((ret = __db_shalloc(&mgr->reginfo, len, 0, &p)) != 0) {
+ TXN_SYSTEM_UNLOCK(dbenv);
__db_err(dbenv,
"Unable to allocate memory for transaction name");
@@ -1063,6 +1065,7 @@
return (ret);
}
+ TXN_SYSTEM_UNLOCK(dbenv);
td->name = R_OFFSET(&mgr->reginfo, p);
memcpy(p, name, len);