--- tdb-1.2.0.orig/debian/libtdb-dev.docs +++ tdb-1.2.0/debian/libtdb-dev.docs @@ -0,0 +1 @@ +docs/README --- tdb-1.2.0.orig/debian/python-tdb.install +++ tdb-1.2.0/debian/python-tdb.install @@ -0,0 +1 @@ +usr/lib/python* --- tdb-1.2.0.orig/debian/copyright +++ tdb-1.2.0/debian/copyright @@ -0,0 +1,75 @@ +This package was debianized by Marek Habersack on +Mon, 7 May 2001 18:03:17 +0200 and subsequently updated heavily +by Jelmer Vernooij . + +The tarball was extracted from Git using the script in +./debian/build-orig.sh + +Upstream Author: Andrew Tridgell + +Files: libreplace/inet_ntop.c libreplace/inet_pton.c +Copyright: Internet Software Consortium. 1996-2001 +License: ISC + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM + DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL + INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: libreplace/*.c +Copyright: + Copyright (c) Andrew Tridgell 1999-2006 + Copyright (c) Jeremy Allison 2000-2003,2007 + Copyright (c) PostgreSQL Global Development Group 1996-2007 + Copyright (c) The Regents of the University of California 1994 + Copyright (c) Michael Adam 2008 + Copyright (c) Patrick Powell 1995 + Copyright (c) Free Software Foundation, Inc. 1991-2001 + Copyright (c) Jelmer Vernooij 2006-2009 + Copyright (c) Kungliga Tekniska Högskolan 1997 +License: LGPL-3+ + Libreplace is licensed under the GNU Lesser General Public License, + version 3 or later. The text of the license is available on Debian + systems in the /usr/share/common-licenses/LGPL-3 file. + +Files: common/*.c +Copyright: + Copyright (c) Andrew Tridgell 1999-2006 + Copyright (c) Paul `Rusty' Russell 2000 + Copyright (c) Jeremy Allison 2000-2003,2007 +License: + The shared library in this package is distributed under the terms + of the GNU Lesser General Public License, version 3 or later. The text + of the license is available on Debian systems in the + /usr/share/common-licenses/LGPL-3 file. + +Files: tools/*.c +Copyright: + Copyright (c) Andrew Tridgell 1999-2006 + Copyright (c) Paul `Rusty' Russell 2000 + Copyright (c) Jeremy Allison 2000-2003,2007 + Copyright (c) Andrew Esh 2001 +License: + The binary utilities in this package are distributed under the terms + of the GNU General Public License, version 3 or later. The text of the + license is available on Debian systems in the + /usr/share/common-licenses/GPL-3 file. + +Files: pytdb.c +Copyright: + Copyright (c) Tim Potter 2004-2006 + Copyright (c) Jelmer Vernooij 2006-2008 +License: + The python module in this package is distributed under the terms + of the GNU Lesser General Public License, version 3 or later. The text + of the license is available on Debian systems in the + /usr/share/common-licenses/LGPL-3 file. + + --- tdb-1.2.0.orig/debian/libtdb1.install +++ tdb-1.2.0/debian/libtdb1.install @@ -0,0 +1 @@ +usr/lib/lib*.so.* --- tdb-1.2.0.orig/debian/tdb-tools.postinst +++ tdb-1.2.0/debian/tdb-tools.postinst @@ -0,0 +1,27 @@ +#! /bin/sh +# postinst script for tdb-tools +# +# see: dh_installdeb(1) + +set -e + +case "$1" in + configure) + update-alternatives --install /usr/bin/tdbbackup tdbbackup /usr/bin/tdbbackup.tdbtools 10 + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 + + --- tdb-1.2.0.orig/debian/watch +++ tdb-1.2.0/debian/watch @@ -0,0 +1,2 @@ +version=3 +ftp://ftp.samba.org/pub/tdb/tdb-(.+).tar.gz --- tdb-1.2.0.orig/debian/libtdb-dev.manpages +++ tdb-1.2.0/debian/libtdb-dev.manpages @@ -0,0 +1 @@ +debian/manpages/* --- tdb-1.2.0.orig/debian/compat +++ tdb-1.2.0/debian/compat @@ -0,0 +1 @@ +5 --- tdb-1.2.0.orig/debian/tdb-tools.prerm +++ tdb-1.2.0/debian/tdb-tools.prerm @@ -0,0 +1,24 @@ +#! /bin/sh +# prerm script for tdb-tools +# +# see: dh_installdeb(1) + +set -e + +case "$1" in + remove|upgrade|deconfigure) + update-alternatives --remove tdbbackup /usr/bin/tdbbackup.tdbtools + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 + + --- tdb-1.2.0.orig/debian/rules +++ tdb-1.2.0/debian/rules @@ -0,0 +1,70 @@ +#!/usr/bin/make -f + +CFLAGS = -g -Wall +SHLD_FLAGS = -shared -Wl,--as-needed + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) +CFLAGS += -O0 +else +CFLAGS += -O2 +endif + +include /usr/share/quilt/quilt.make + +DESTDIR=$(CURDIR)/debian/tmp + +configure: patch configure-stamp +configure-stamp: + dh_testdir + CFLAGS="$(CFLAGS)" ./configure --prefix=/usr + touch configure-stamp + +build: configure build-stamp +build-stamp: + dh_testdir + $(MAKE) all SHLD_FLAGS="$(SHLD_FLAGS)" + touch build-stamp + +clean: clean-patched unpatch +clean-patched: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + [ ! -f Makefile ] || $(MAKE) distclean + rm -rf build + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + $(MAKE) install DESTDIR=$(DESTDIR) + touch -t 201101010101 `find $(CURDIR)/debian/tmp` + mv $(CURDIR)/debian/tmp/usr/bin/tdbbackup \ + $(CURDIR)/debian/tmp/usr/bin/tdbbackup.tdbtools + ln -s libtdb.so.1.* $(DESTDIR)/usr/lib/libtdb.so.1 + ln -s libtdb.so.1 $(DESTDIR)/usr/lib/libtdb.so + dh_install --fail-missing --list-missing --sourcedir=$(DESTDIR) + +binary-indep: +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installman + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs -V 'libtdb1 (>= 1.1.3~git2008122-1)' -- -c4 + dh_pycentral + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary install configure --- tdb-1.2.0.orig/debian/libtdb-dev.install +++ tdb-1.2.0/debian/libtdb-dev.install @@ -0,0 +1,4 @@ +usr/include/* +usr/lib/pkgconfig/tdb.pc +usr/lib/lib*.a +usr/lib/lib*.so --- tdb-1.2.0.orig/debian/libtdb-dev.dirs +++ tdb-1.2.0/debian/libtdb-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include --- tdb-1.2.0.orig/debian/libtdb1.symbols +++ tdb-1.2.0/debian/libtdb1.symbols @@ -0,0 +1,62 @@ +libtdb.so.1 libtdb1 #MINVER# + tdb_add_flags@Base 1.1.2~git20080520 + tdb_append@Base 1.0.6 + tdb_chainlock@Base 1.0.6 + tdb_chainlock_mark@Base 1.1.1~svn26294 + tdb_chainlock_nonblock@Base 1.1.0 + tdb_chainlock_read@Base 1.0.6 + tdb_chainlock_unmark@Base 1.1.1~svn26294 + tdb_chainunlock@Base 1.0.6 + tdb_chainunlock_read@Base 1.0.6 + tdb_check@Base 1.2.0 + tdb_close@Base 1.0.6 + tdb_delete@Base 1.0.6 + tdb_dump_all@Base 1.0.6 + tdb_enable_seqnum@Base 1.1.1~svn26294 + tdb_error@Base 1.0.6 + tdb_errorstr@Base 1.0.6 + tdb_exists@Base 1.0.6 + tdb_fd@Base 1.1.0 + tdb_fetch@Base 1.0.6 + tdb_firstkey@Base 1.0.6 + tdb_freelist_size@Base 1.1.2~git20080520 + tdb_get_flags@Base 1.1.0 + tdb_get_logging_private@Base 1.1.0 + tdb_get_seqnum@Base 1.1.0 + tdb_hash_size@Base 1.1.0 + tdb_increment_seqnum_nonblock@Base 1.1.1~svn26294 + tdb_lockall@Base 1.0.6 + tdb_lockall_mark@Base 1.1.1~svn26294 + tdb_lockall_nonblock@Base 1.1.1~svn26294 + tdb_lockall_read@Base 1.1.0 + tdb_lockall_read_nonblock@Base 1.1.1~svn26294 + tdb_lockall_unmark@Base 1.1.1~svn26294 + tdb_log_fn@Base 1.1.0 + tdb_logging_function@Base 1.0.6 + tdb_map_size@Base 1.1.0 + tdb_name@Base 1.1.0 + tdb_nextkey@Base 1.0.6 + tdb_null@Base 1.0.6 + tdb_open@Base 1.0.6 + tdb_open_ex@Base 1.0.6 + tdb_parse_record@Base 1.1.0 + tdb_printfreelist@Base 1.0.6 + tdb_remove_flags@Base 1.1.2~git20080520 + tdb_reopen@Base 1.0.6 + tdb_reopen_all@Base 1.0.6 + tdb_repack@Base 1.1.2~git20081222 + tdb_set_logging_function@Base 1.1.0 + tdb_set_max_dead@Base 1.1.0 + tdb_setalarm_sigptr@Base 1.1.1~svn26294 + tdb_store@Base 1.0.6 + tdb_transaction_cancel@Base 1.1.0 + tdb_transaction_commit@Base 1.1.0 + tdb_transaction_prepare_commit@Base 1.1.5 + tdb_transaction_recover@Base 1.1.0 + tdb_transaction_start@Base 1.1.0 + tdb_traverse@Base 1.0.6 + tdb_traverse_read@Base 1.1.0 + tdb_unlockall@Base 1.0.6 + tdb_unlockall_read@Base 1.1.0 + tdb_validate_freelist@Base 1.1.0 + tdb_wipe_all@Base 1.1.2~git20080520 --- tdb-1.2.0.orig/debian/tdb-tools.install +++ tdb-1.2.0/debian/tdb-tools.install @@ -0,0 +1 @@ +usr/bin/tdb* --- tdb-1.2.0.orig/debian/changelog +++ tdb-1.2.0/debian/changelog @@ -0,0 +1,279 @@ +tdb (1.2.0-0ubuntu3) karmic; urgency=low + + * And towards the future. + + -- Jelmer Vernooij Wed, 16 Dec 2009 12:58:37 +0100 + +tdb (1.2.0-0ubuntu2) karmic; urgency=low + + * Go back to the seventies. + + -- Jelmer Vernooij Wed, 16 Dec 2009 12:55:59 +0100 + +tdb (1.2.0-0ubuntu1) karmic; urgency=low + + * Build for karmic. + + -- Jelmer Vernooij Mon, 14 Dec 2009 02:59:57 +0100 + +tdb (1.2.0-1) unstable; urgency=low + + * New upstream release. + * Rename tdb-dev -> libtdb-dev. + * Bump standards version to 3.8.3. + + -- Jelmer Vernooij Mon, 07 Dec 2009 22:18:51 +0100 + +tdb (1.1.5-2) unstable; urgency=low + + * Provide a symbols file. + * Provide deprecated replacement of public tdb_logging_function symbol + removed upstream without soname bump. Closes: #511011 + * Fix use of --as-needed. + * Bump standards version to 3.8.2. + + -- Jelmer Vernooij Sat, 18 Jul 2009 12:15:43 +0200 + +tdb (1.1.5-1) unstable; urgency=low + + * New upstream release. + + -- Jelmer Vernooij Wed, 17 Jun 2009 16:57:30 +0200 + +tdb (1.1.3-1) unstable; urgency=low + + * New upstream release. + * Bump standards version to 3.8.1. + + -- Jelmer Vernooij Sat, 16 May 2009 03:39:51 +0200 + +tdb (1.1.3~git20090221-1) unstable; urgency=low + + * New upstream snapshot. + * Upload to unstable. + * Link with --as-needed. + + -- Jelmer Vernooij Sat, 21 Feb 2009 17:27:45 +0100 + +tdb (1.1.3~git20081222-2) experimental; urgency=low + + * Switch to python-central. + * Add dummy watchfile explaining how to obtain an upstream tarball. + * Fix version number. (Closes: #510885) + * Bump shlibs because of newly added tdb_repack() symbol. (Closes: #510886) + * Remove use of absolute paths per policy §6.1. (Closes: #510944) + + -- Jelmer Vernooij Sun, 25 Jan 2009 00:13:16 +0100 + +tdb (1.1.2~git20081222-1) unstable; urgency=low + + * New upstream snapshot. + + -- Jelmer Vernooij Mon, 22 Dec 2008 23:59:23 +0100 + +tdb (1.1.2~git20080615-1) unstable; urgency=low + + * New upstream snapshot. + * Bump standards version to 3.8.0. + + -- Jelmer Vernooij Mon, 16 Jun 2008 00:41:17 +0200 + +tdb (1.1.2~git20080521-1) unstable; urgency=low + + * New upstream snapshot. + * Fix soname symlink. (Closes: #482008, Closes: #482228) + + -- Jelmer Vernooij Wed, 21 May 2008 17:41:28 +0200 + +tdb (1.1.2~git20080520-1) unstable; urgency=low + + * New upstream snapshot. + + -- Jelmer Vernooij Tue, 20 May 2008 01:52:37 +0200 + +tdb (1.1.1~svn26294-2) unstable; urgency=low + + * Add patch to clear spinlocks if set and opening a TDB in write mode. + (Closes: #425716) + * Change tdb-dev section to libdevel. + + -- Jelmer Vernooij Tue, 25 Mar 2008 21:43:50 +0100 + +tdb (1.1.1~svn26294-1.1) unstable; urgency=low + + * Non-maintainer upload. + * 10_include_signalh.diff (Closes: #460302). + + Include signal.h in tdb.h. + * Re-add manpages. (Closes: #439809). + + Fix manpage sections. + + Escape hyphens as minus signs. + * Fix return value in tdb_delete.3. (Closes: #385389). + * Add ${shlibs:Depends} on python-tdb package. + + -- Barry deFreese Sat, 08 Mar 2008 22:34:03 -0500 + +tdb (1.1.1~svn26294-1) unstable; urgency=low + + * New upstream snapshot. + * Set Vcs-Svn field. + * Support building twice in a row. (Closes: #442743) + * Install SWIG file. + * Upload to unstable. + + -- Jelmer Vernooij Tue, 04 Dec 2007 19:23:26 +0100 + +tdb (1.1.1~svn26181-1) unstable; urgency=low + + * Set homepage field. + * New upstream snapshot. + * Add python-tdb package. + * Allow Debian Maintainer uploads. + + -- Jelmer Vernooij Sun, 25 Nov 2007 16:31:28 +0000 + +tdb (1.1.0-1) unstable; urgency=low + + * New upstream release. + * Removes spinlock code. (Closes: #400802) + * References to tdb_lockkeys() were removed. (Closes: #309994) + * Provide tdb_chain(un)lock() functions. (Closes: #412817) + * New maintainer. (Closes: #411687) + * Drop dependency on gdbm-dev. + * Fix typo in copyright file. (Closes: #337506) + + -- Jelmer Vernooij Wed, 02 May 2007 20:02:08 +0200 + +tdb (1.0.6-13) unstable; urgency=high + + * Closes: #307214: ctrlproxy: FTBFS: /usr/include/tdb.h:150: error: + parse error before '*' token + * Thanks to Wilmer van der Gaast for providing + the patch to fix the above issue. + * Closes: #290211: Improper copyright file + * Closes: #262490: tdb_1.0.6-8_mips: FTBFS: opcode not supported on + this processor: mips1. Spinlocks are not used on mips. + + -- Marek Habersack Wed, 4 May 2005 11:11:22 -0400 + +tdb (1.0.6-12) unstable; urgency=medium + + * Closes: #305771: libtdb is LGPL, rather than GPL as stated in + copyright + * Updated the configure file with the correct license information. + * The binaries accompanying the library are _mostly_ marked as licensed + under the GPL. As the effect, I'm (for now) assumming that those binaries + that do not bear the license text are GPL-ed as well. + * The sources have been updated from the Samba 3.0.14a release. + * Closes: #305867: tdb fails to build on athlon64 running sarge/i386. + Thanks to Len Sorensen for noticing that + and providing the fix. + + -- Marek Habersack Fri, 22 Apr 2005 17:39:20 -0400 + +tdb (1.0.6-11) unstable; urgency=high + + * Added #include in tdb.h, to get the definition of + sig_atomic_t (closes: Bug#264601) + + -- Marek Habersack Mon, 9 Aug 2004 20:05:36 +0200 + +tdb (1.0.6-10) unstable; urgency=high + + * tdbbackup is registered with the alternatives system now so that it + does not conflict with the Samba package (closes: Bug#262605) + + -- Marek Habersack Mon, 2 Aug 2004 01:58:39 +0200 + +tdb (1.0.6-9) unstable; urgency=high + + * MIPS doesn't want to cooperate on the spinlocks. Disabling it for the + architecture (closes: Bug#262490). + + -- Marek Habersack Sun, 1 Aug 2004 03:07:55 +0200 + +tdb (1.0.6-8) unstable; urgency=low + + * Updated the sources to their versions from the samba 3.0.5 package. + The interface is 100% backward compatible. + * Updated the Standards Version. No changes. + * Enabled spinlocks for architectures that are supported (x86,sparc, + mips,powerpc) + + -- Marek Habersack Sat, 31 Jul 2004 03:23:39 +0200 + +tdb (1.0.6-7) unstable; urgency=high + + * Updated the libtool version (closes: Bug#201928) + + -- Marek Habersack Fri, 18 Jul 2003 14:24:00 -0400 + +tdb (1.0.6-6) unstable; urgency=high + + * Bumped the standards version + * Depends on debconf > 4.0 + * Fixed the build-time dependencies. Correctly depends on libgdbm-dev + instead of on libgdbm1-dev (closes: Bug#199608) + + -- Marek Habersack Tue, 1 Jul 2003 18:16:09 -0400 + +tdb (1.0.6-5) unstable; urgency=low + + * Modified tdbtool.c to properly use multi-line strings + (closes: Bug#195257) + * Corrected the copyright file to not use the boilerplate. + + -- Marek Habersack Thu, 29 May 2003 15:25:54 -0400 + +tdb (1.0.6-4) unstable; urgency=high + + * made dependencies right for tdb-dev (closes: #143517) + + -- Marek Habersack Thu, 18 Apr 2002 23:55:53 +0200 + +tdb (1.0.6-3) unstable; urgency=high + + * Added the shared library module. It is needed for some packages on hppa. + + -- Marek Habersack Mon, 15 Apr 2002 19:28:09 +0200 + +tdb (1.0.6-2) unstable; urgency=high + + * Upgraded the config.guess and config.sub files (closes: #138609) + + -- Marek Habersack Sun, 17 Mar 2002 00:35:25 +0100 + +tdb (1.0.6-1) unstable; urgency=medium + + * Latest upstream (closes: #137972) + + -- Marek Habersack Wed, 13 Mar 2002 02:43:47 +0100 + +tdb (1.0.3-4) unstable; urgency=low + + * Updated config.guess and config.sub (closes: #103348) + * Binaries in tdb-tools no longer are linked against the shared + tdb library (closes: #102498) + + -- Marek Habersack Wed, 4 Jul 2001 11:48:34 +0200 + +tdb (1.0.3-3) unstable; urgency=low + + * Fixed incorrect dependency on tdb1 + + -- Marek Habersack Thu, 17 May 2001 13:21:11 +0200 + +tdb (1.0.3-2) unstable; urgency=low + + * Changed the package description. Closes: #97636 + + -- Marek Habersack Wed, 16 May 2001 10:47:10 +0200 + +tdb (1.0.3-1) unstable; urgency=low + + * Initial Release. + + -- Marek Habersack Mon, 7 May 2001 18:03:17 +0200 + +Local variables: +mode: debian-changelog +End: --- tdb-1.2.0.orig/debian/control +++ tdb-1.2.0/debian/control @@ -0,0 +1,68 @@ +Source: tdb +Section: devel +Priority: optional +Maintainer: Jelmer Vernooij +Build-Depends: debhelper (>> 5.0.0), quilt (>= 0.40), python-central (>= 0.5.6), python-dev +Homepage: http://tdb.samba.org/ +Standards-Version: 3.8.3 +Vcs-Svn: svn://svn.debian.org/pkg-samba/trunk/tdb +XS-Python-Version: all + +Package: libtdb1 +Architecture: any +Section: libs +Depends: ${shlibs:Depends} +XB-Python-Version: ${python:Versions} +Description: Trivial Database - shared library + This is a simple database API. It is modelled after the structure + of GDBM. TDB features, unlike GDBM, multiple writers support with + appropriate locking and transactions. + . + This package contains the shared library file. + +Package: tdb-tools +Section: utils +Architecture: any +Depends: ${shlibs:Depends} +XB-Python-Version: ${python:Versions} +Description: Trivial Database - bundled binaries + This is a simple database API. It is modelled after the structure + of GDBM. TDB features, unlike GDBM, multiple writers support with + appropriate locking and transactions. + . + This package contains bundled test and utility binaries + +Package: libtdb-dev +Provides: tdb-dev +Replaces: tdb-dev (<< 1.2.0-1) +Conflicts: tdb-dev (<< 1.2.0-1) +Section: libdevel +Architecture: any +Depends: libc6-dev, libtdb1 (= ${binary:Version}) +XB-Python-Version: ${python:Versions} +Description: Trivial Database - development files + This is a simple database API. It is modelled after the structure + of GDBM. TDB features, unlike GDBM, multiple writers support with + appropriate locking and transactions. + . + This package contains the development files. + +Package: python-tdb +Section: python +Architecture: any +Depends: ${python:Depends}, ${shlibs:Depends}, libtdb1 (= ${binary:Version}) +Provides: ${python:Provides} +XB-Python-Version: ${python:Versions} +Description: Python bindings for TDB + TDB is a simple database API. + . + This package contains the Python bindings. + +Package: tdb-dev +Depends: libtdb-dev +Architecture: all +XB-Python-Version: ${python:Versions} +Description: transitional dummy package + This is a dummy package to ease transition to new package name. + . + You can safely remove it after the upgrade. --- tdb-1.2.0.orig/debian/manpages/tdb_traverse.3 +++ tdb-1.2.0/debian/manpages/tdb_traverse.3 @@ -0,0 +1,52 @@ +.TH TDB_TRAVERSE 3 "Aug 16, 2000" "Samba" "Linux Programmer's Manual" +.SH NAME +tdb_traverse \- visit every element in a tdb database +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int tdb_traverse(TDB_CONTEXT *" tdb ", " +.BI " int (*" fn ")(TDB_CONTEXT *,TDB_DATA,TDB_DATA,void *)," +.BI " void *state);" +.sp +.SH DESCRIPTION +.I tdb_traverse is the only sure way to visit all the items within a +given database, +.I tdb +Because this function has intimate knowledge of the internals of the +database, it is able to cope with writers touching the database at the +same time it is trying to traverse it. +.sp +If +.I fn +is supplied it will be called with the +.I state parameter +for each element in the database, as the forth argument. The First argument is +the database +.I tdb +the second is the key and the third is the data. If this function call returns +anything but 0, the traversal will stop. Unlike in tdb_fetch() the programmer +is not required to free either the pointer from either the key or data +parameters that are passed into the function. The +.I fn +function should have the prototype: +.nf +.in 10 +int (*tdb_traverse_func)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, void *); +.fi +.PP +.sp +Calling tdb_traverse with a NULL +.I fn +parameter is the appropriate way to count the number of elements in +the database. +.SH "RETURN VALUE" +The return value is the number of elements traversed or \-1 if there +was an error. +.SH AUTHORS +Software: Andrew Tridgell and +Luke Kenneth Casson Leighton +Man page: Ben Woodard +.SH "SEE ALSO" +.BR gdbm (3), +.BR tdb(3) --- tdb-1.2.0.orig/debian/manpages/tdb_chainlock.3 +++ tdb-1.2.0/debian/manpages/tdb_chainlock.3 @@ -0,0 +1,31 @@ +.TH TDB_CHAINLOCK 3 "Oct 13, 2000" "Samba" "Linux Programmer's Manual" +.SH NAME +tdb_chainlock \- lock a group of keys +tdb_chainunlock \- unlock a previously locked group of keys +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int tdb_chainlock(TDB_CONTEXT *" tdb ", TDB_DATA " key ");" +.BI "void tdb_chainunlock(TDB_CONTEXT *" tdb ", TDB_DATA " key ");" +.sp +.SH DESCRIPTION +.I tdb_chainlock +is a low\-level function used to lock a particular key (and a number of +other keys) without any checking: any other process attempting to +perform tdb operations on those keys will block until +.I tdb_chainunlock +is called. +.SH NOTES +It is the user's responsibility to ensure that they do not deadlock +the database using these functions: something which is impossible +using the other access functions. +.SH "RETURN VALUE" +A return value of 0 indicates success and \-1 indicates failure. +.SH AUTHORS +Software: Andrew Tridgell +Man page: Rusty. +.SH "SEE ALSO" +.BR gdbm (3), +.BR tdb (3), +.BR tdb_lockall (3). --- tdb-1.2.0.orig/debian/manpages/tdb.3 +++ tdb-1.2.0/debian/manpages/tdb.3 @@ -0,0 +1,32 @@ +.TH TDB 3 "Aug 16, 2000" "Samba" "Linux Programmer's Manual" +.SH NAME +tdb - trivial database +.SH SYNOPSIS +A database similar to gdbm which allows multiple simultaneous writers. +.SH DESCRIPTION +This is a simple database API. It was inspired by the realisation that +in Samba we have several ad-hoc bits of code that essentially +implement small databases for sharing structures between parts of +Samba. As I was about to add another I realised that a generic +database module was called for to replace all the ad-hoc bits. +.sp +I based the interface on gdbm. I couldn't use gdbm as we need to be +able to have multiple writers to the databases at one time. +.SH AUTHORS +Software: Andrew Tridgell and +Luke Kenneth Casson Leighton +Man page: Ben Woodard +.SH "SEE ALSO" +.BR gdbm (3), +.BR tdb_open (3), +.BR tdb_close (3), +.BR tdb_delete (3), +.BR tdb_error (3), +.BR tdb_exists (3), +.BR tdb_fetch (3), +.BR tdb_firstkey (3), +.BR tdb_store (3), +.BR tdb_traverse (3), +.BR tdb_lockall (3), +.BR tdb_lockkeys (3), +.BR tdb_chainlock (3) --- tdb-1.2.0.orig/debian/manpages/tdb_firstkey.3 +++ tdb-1.2.0/debian/manpages/tdb_firstkey.3 @@ -0,0 +1,82 @@ +.TH TDB_FIRSTKEY 3 "Aug 16, 2000" "Samba" "Linux Programmer's Manual" +.SH NAME +tdb_firstkey - return the key of the first record in a tdb database +tdb_nextkey - return the key of next record in the tdb database +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "TDB_DATA tdb_firstkey(TDB_CONTEXT *" tdb ");" +.BI "TDB_DATA tdb_nextkey(TDB_CONTEXT *" tdb ", TDB_DATA " prev_key ");" +.sp +.SH DESCRIPTION +.I tdb_firstkey +fetches the key of the first entry in the +.I tdb +database. +.I tdb_nextkey +fetches the key of the entry immediately after +.I prev_key +in the database. +.sp +The TDB_DATA structure returned by both these functions is defined as: +.PP +.RS +.nf +typedef struct { + char *dptr; + size_t dsize; +} TDB_DATA; +.fi +.RE +.PP +.sp +The order in which this traverses the database is its own internal +hash order. Do not expect the keys to be in any recognizably sorted +order. +.sp +These functions are reliable even if other writers are accessing the +database (or you are replacing or deleting elements as you traverse), +except in the case of nested +.I tdb_firstkey +or +.I tdb_nextkey +calls. For example, the following outer traversal may fail to +traverse all the elements, or may even traverse elements twice if +other processes are manipulating the database: +.PP +.RS +.nf + TDB_DATA i, j; + + for (i = tdb_firstkey(tdb); i.dptr; i = tdb_nextkey(tdb, i)) { + for (j = tdb_firstkey(tdb); j.dptr; j = tdb_nextkey(tdb, j)) { + ... + } + } +.fi +.RE +.PP +If such behaviour is desired, use +.I tdb_traverse +instead. +.sp +.SH "RETURN VALUE" +If the call succeeds, then a TDB_DATA structure is returned with the +.I dptr +structure filled in. If the call fails or you have reached the end of +the database then +.I dptr +will be set to NULL. +.sp +.B NOTE: +The caller is responsible for freeing the data pointed to by +.I dptr +. +.SH AUTHORS +Software: Andrew Tridgell and +Luke Kenneth Casson Leighton +Man page: Ben Woodard +.SH "SEE ALSO" +.BR gdbm (3), +.BR tdb(3) --- tdb-1.2.0.orig/debian/manpages/tdb_exists.3 +++ tdb-1.2.0/debian/manpages/tdb_exists.3 @@ -0,0 +1,37 @@ +.TH TDB_EXISTS 3 "Aug 17, 2000" "Samba" "Linux Programmer's Manual" +.SH NAME +tdb_exists - check for the existence of a record in a tdb database +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int tdb_exists(TDB_CONTEXT *" tdb ", TDB_DATA " key ");" +.sp +.SH DESCRIPTION +Test to see if a key exists. +.I tdb +is a pointer returned by +.B tdb_open +and +.I key +is a lump of data that is used as the index into the database. The TDB_DATA +structure is defined as: +.PP +.RS +.nf +typedef struct { + char *dptr; + size_t dsize; +} TDB_DATA; +.fi +.RE +.PP +.SH "RETURN VALUE" +If the key is found, 1 is returned; otherwise 0 is returned. +.SH AUTHORS +Software: Andrew Tridgell and +Luke Kenneth Casson Leighton +Man page: Ben Woodard +.SH "SEE ALSO" +.BR gdbm (3), +.BR tdb(3) --- tdb-1.2.0.orig/debian/manpages/tdb_delete.3 +++ tdb-1.2.0/debian/manpages/tdb_delete.3 @@ -0,0 +1,35 @@ +.TH TDB_DELETE 3 "Aug 16, 2000" "Samba" "Linux Programmer's Manual" +.SH NAME +tdb_delete \- delete a record from a tdb database +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int tdb_delete(TDB_CONTEXT *" tdb ", TDB_DATA " key ");" +.sp +.SH DESCRIPTION +Delete the record from the +.I tdb +database whose key matches +.I key +, a lump of data that is used as the index into the database. The +TDB_DATA structure is defined as: +.PP +.RS +.nf +typedef struct { + char *dptr; + size_t dsize; +} TDB_DATA; +.fi +.RE +.PP +.SH "RETURN VALUE" +A return value of 0 indicates success and \-1 indicates failure. +.SH AUTHORS +Software: Andrew Tridgell and +Luke Kenneth Casson Leighton +Man page: Ben Woodard +.SH "SEE ALSO" +.BR gdbm (3), +.BR tdb(3) --- tdb-1.2.0.orig/debian/manpages/tdb_error.3 +++ tdb-1.2.0/debian/manpages/tdb_error.3 @@ -0,0 +1,25 @@ +.TH TDB_ERROR 3 "Aug 16, 2000" "Samba" "Linux Programmer's Manual" +.SH NAME +tdb_error - return tdb database error state information. +tdb_errorstr - return a printable string representing the error state of a tdb\ + database +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "enum TDB_ERROR tdb_error(TDB_CONTEXT *" tdb ");" +.BI "char *tdb_errorstr(TDB_CONTEXT *" tdb ");" +.sp +.SH DESCRIPTION +.I tdb_error returns the current error state of the +.I tdb +database. +.I tdb_errorstr +returns a printable string that describes the error state of the +database. +.SH AUTHORS +Software: Andrew Tridgell and Luke Kenneth +Casson Leighton Man page: Ben Woodard +.SH "SEE ALSO" +.BR gdbm (3), +.BR tdb(3) --- tdb-1.2.0.orig/debian/manpages/tdb_fetch.3 +++ tdb-1.2.0/debian/manpages/tdb_fetch.3 @@ -0,0 +1,45 @@ +.TH TDB_FETCH 3 "Aug 16, 2000" "Samba" "Linux Programmer's Manual" +.SH NAME +tdb_fetch - fetch a record from a tdb database +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "TDB_DATA tdb_fetch(TDB_CONTEXT *" tdb ", TDB_DATA " key ");" +.sp +.SH DESCRIPTION +Fetch the record from the +.I tdb +database whose key matches +.I key +, a lump of data that is used as the index into the database. +.sp +The TDB_DATA structure used for both the key and the return value is +defined as: +.PP +.RS +.nf +typedef struct { + char *dptr; + size_t dsize; +} TDB_DATA; +.fi +.RE +.PP +.SH "RETURN VALUE" +If the call succeeds, then a TDB_DATA structure is returned with the +.I dptr +structure filled in. If the call fails then +.I dptr +will be set to NULL. +.sp +.B NOTE: +The caller is responsible for freeing the data pointed to by +.I dptr. +.SH AUTHORS +Software: Andrew Tridgell and +Luke Kenneth Casson Leighton +Man page: Ben Woodard +.SH "SEE ALSO" +.BR gdbm (3), +.BR tdb(3) --- tdb-1.2.0.orig/debian/manpages/tdb_open.3 +++ tdb-1.2.0/debian/manpages/tdb_open.3 @@ -0,0 +1,59 @@ +.TH TDB_OPEN 3 "Aug 16, 2000" "Samba" "Linux Programmer's Manual" +.SH NAME +tdb_open \- Open a tdb database. +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "TDB_CONTEXT *tdb_open(const char *" pathname ", int " hash_size "," +.BI " int " tdb_flags ", int " open_flags ", mode_t " mode " );" +.sp +.SH DESCRIPTION +Open the database, creating it if necessary. The +.I hash +size is advisory, use zero for a default value. +.I tdb_flags +can be one of +.TP +.B TDB_CLEAR_IF_FIRST +Clear database if we are the only one with it open. +.TP +.B TDB_INTERNAL +Don't use a file, instead store the data in memory. The +.I pathname +, +.I open_flags +, and +.I mode +are ignored in +this case. This is useful if you need a quick associative array or map. +.TP +.B TDB_NOLOCK +Don't do any locking (this is always turned on for read-only file +descriptors) +.TP +.B TDB_NOMMAP +Don't use mmap. +.TP +.B TDB_CONVERT +Create a database in the reverse of native endian: normally when the +database is created (or cleared with TDB_CLEAR_IF_FIRST), it is +created in native endian order. This flag is set (or unset) +automatically for existing databases. +.PP +The +.I open_flags +and +.I mode +are passed straight to the open call on the database file. A flags +value of O_WRONLY is invalid. +.SH "RETURN VALUE" +On success a pointer to an opaque data structure, a TDB_CONTEXT is +returned. On error a NULL is returned. +.SH AUTHORS +Software: Andrew Tridgell and Luke Kenneth Casson Leighton +Man page: Ben Woodard +.SH "SEE ALSO" +.BR open (2), +.BR gdbm (3), +.BR tdb(3) --- tdb-1.2.0.orig/debian/manpages/tdb_close.3 +++ tdb-1.2.0/debian/manpages/tdb_close.3 @@ -0,0 +1,19 @@ +.TH TDB_CLOSE 3 "Aug 16, 2000" "Samba" "Linux Programmer's Manual" +.SH NAME +tdb_close \- close a tdb database +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int tdb_close(TDB_CONTEXT *" tdb ");" +.sp +.SH DESCRIPTION +Closes a TDB database and frees memory any memory that was used. +.SH "RETURN VALUE" +Returns zero on success and \-1 on failure. +.SH AUTHORS +Software: Andrew Tridgell and Luke Kenneth Casson Leighton +Man page: Ben Woodard +.SH "SEE ALSO" +.BR gdbm (3), +.BR tdb(3) --- tdb-1.2.0.orig/debian/manpages/tdb_store.3 +++ tdb-1.2.0/debian/manpages/tdb_store.3 @@ -0,0 +1,55 @@ +.TH TDB_STORE 3 "Aug 16, 2000" "Samba" "Linux Programmer's Manual" +.SH NAME +tdb_store \- store a record in a tdb database. +.SH SYNOPSIS +.nf +.B #include +.sp +.BI "int tdb_store(TDB_CONTEXT *" tdb ", TDB_DATA " key ", TDB_DATA " record ", int " flag ");" +.sp +.SH DESCRIPTION +Store a lump of data pointed to by +.I record +in the +.I tdb +database under the index pointed to by +.I key. +The TDB_DATA structure used by both +.I key +and +.I record +is defined as: +.PP +.RS +.nf +typedef struct { + char *dptr; + size_t dsize; +} TDB_DATA; +.fi +.RE +.PP +The +.I flag +determines the way that tdb_store behaves and can be any one of the +following values. +.TP +.B TDB_REPLACE +Insert a record creating a new one or overwriting an existing one. +.TP +.B TDB_INSERT +Insert a new entry but refuse to overwrite an existing entry. +.TP +.B TDB_MODIFY +Replace an existing record with a new one. This will fail if, +a record does not already exist. +.PP +.SH "RETURN VALUE" +A return value of 0 indicates success and \-1 indicates failure. +.SH AUTHORS +Software: Andrew Tridgell and +Luke Kenneth Casson Leighton +Man page: Ben Woodard +.SH "SEE ALSO" +.BR gdbm (3), +.BR tdb(3) --- tdb-1.2.0.orig/debian/patches/series +++ tdb-1.2.0/debian/patches/series @@ -0,0 +1 @@ +30_tdb_logging_func.diff --- tdb-1.2.0.orig/debian/patches/30_tdb_logging_func.diff +++ tdb-1.2.0/debian/patches/30_tdb_logging_func.diff @@ -0,0 +1,40 @@ +Provide public symbol tdb_logging_function removed upstream without major +version change. (bug #511011) + +diff -ur tdb-1.1.5/common/open.c tdb-1.1.5-fixed/common/open.c +--- tdb-1.1.5/common/open.c 2009-05-23 16:37:50.000000000 +0200 ++++ tdb-1.1.5-fixed/common/open.c 2009-07-18 12:46:08.000000000 +0200 +@@ -400,6 +400,11 @@ + tdb->log = *log_ctx; + } + ++void tdb_logging_function(struct tdb_context *tdb, tdb_log_func fn) ++{ ++ tdb->log.log_fn = fn; ++} ++ + void *tdb_get_logging_private(struct tdb_context *tdb) + { + return tdb->log.log_private; +diff -ur tdb-1.1.5/include/tdb.h tdb-1.1.5-fixed/include/tdb.h +--- tdb-1.1.5/include/tdb.h 2009-05-23 16:37:50.000000000 +0200 ++++ tdb-1.1.5-fixed/include/tdb.h 2009-07-18 12:45:57.000000000 +0200 +@@ -99,6 +99,7 @@ + + int tdb_reopen(struct tdb_context *tdb); + int tdb_reopen_all(int parent_longlived); ++__attribute__((deprecated)) void tdb_logging_function(struct tdb_context *tdb, tdb_log_func); + void tdb_set_logging_function(struct tdb_context *tdb, const struct tdb_logging_context *log_ctx); + enum TDB_ERROR tdb_error(struct tdb_context *tdb); + const char *tdb_errorstr(struct tdb_context *tdb); +diff -ur tdb-1.1.5/tdb.exports tdb-1.1.5-fixed/tdb.exports +--- tdb-1.1.5/tdb.exports 2009-06-15 23:06:56.000000000 +0200 ++++ tdb-1.1.5-fixed/tdb.exports 2009-07-18 13:03:14.000000000 +0200 +@@ -22,6 +22,7 @@ + tdb_freelist_size; + tdb_get_flags; + tdb_get_logging_private; ++ tdb_logging_function; + tdb_get_seqnum; + tdb_hash_size; + tdb_increment_seqnum_nonblock; --- tdb-1.2.0.orig/debian/patches/20_clear_spinlocks.diff +++ tdb-1.2.0/debian/patches/20_clear_spinlocks.diff @@ -0,0 +1,78 @@ +diff -ur tdb-1.1.1~svn26294/common/open.c tdb-1.1.1~svn26294-fixed/common/open.c +--- tdb-1.1.1~svn26294/common/open.c 2007-08-11 23:19:24.000000000 +0200 ++++ tdb-1.1.1~svn26294-fixed/common/open.c 2008-03-25 22:35:24.000000000 +0100 +@@ -141,6 +141,20 @@ + { + } + ++/* Clean up spinlock pointer */ ++static int tdb_clear_spinlocks(struct tdb_context *tdb) ++{ ++ off_t off = (off_t)((char *)&tdb->header.rwlocks ++ - (char *)&tdb->header); ++ ++ tdb->header.rwlocks = 0; ++ if (lseek(tdb->fd, off, SEEK_SET) != off ++ || write(tdb->fd, (void *)&tdb->header.rwlocks, ++ sizeof(tdb->header.rwlocks)) ++ != sizeof(tdb->header.rwlocks)) ++ return -1; ++ return 0; ++} + + struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags, + int open_flags, mode_t mode, +@@ -222,9 +236,12 @@ + goto fail; /* errno set by tdb_brlock */ + } + ++ if ((tdb_flags & TDB_CLEAR_IF_FIRST)) { ++ locked = (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0, 1) == 0); ++ } ++ + /* we need to zero database if we are the only one with it open */ +- if ((tdb_flags & TDB_CLEAR_IF_FIRST) && +- (locked = (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0, 1) == 0))) { ++ if ((tdb_flags & TDB_CLEAR_IF_FIRST) && locked) { + open_flags |= O_CREAT; + if (ftruncate(tdb->fd, 0) == -1) { + TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_open_ex: " +@@ -261,11 +278,6 @@ + if (fstat(tdb->fd, &st) == -1) + goto fail; + +- if (tdb->header.rwlocks != 0) { +- TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: spinlocks no longer supported\n")); +- goto fail; +- } +- + /* Is it already in the open list? If so, fail. */ + if (tdb_already_open(st.st_dev, st.st_ino)) { + TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: " +@@ -285,14 +297,26 @@ + tdb->inode = st.st_ino; + tdb->max_dead_records = 0; + tdb_mmap(tdb); ++ if (!locked && tdb->header.rwlocks != 0) { ++ locked = (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0, 1) == 0); ++ } ++ + if (locked) { ++ /* Clear up spinlocks if there were any remaining */ ++ if (tdb->header.rwlocks != 0 && !tdb->read_only) ++ tdb_clear_spinlocks(tdb); ++ + if (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_UNLCK, F_SETLK, 0, 1) == -1) { + TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: " + "failed to take ACTIVE_LOCK on %s: %s\n", + name, strerror(errno))); + goto fail; + } ++ } + ++ if (tdb->header.rwlocks != 0) { ++ TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: spinlocks no longer supported\n")); ++ goto fail; + } + + /* We always need to do this if the CLEAR_IF_FIRST flag is set, even if