[Debtags-commits] [svn] r938 - in libdebtags1/trunk: . debian debtags

Enrico Zini debtags-commits@lists.alioth.debian.org
Sat, 18 Jun 2005 22:46:14 +0000


Author: enrico
Date: Sat Jun 18 22:46:13 2005
New Revision: 938

Modified:
   libdebtags1/trunk/README
   libdebtags1/trunk/configure.ac
   libdebtags1/trunk/debian/changelog
   libdebtags1/trunk/debtags/TagDB.cc
   libdebtags1/trunk/debtags/Update.cc
Log:
Ported to the new double-tdb-index in libtagcoll1

Modified: libdebtags1/trunk/README
==============================================================================
--- libdebtags1/trunk/README	(original)
+++ libdebtags1/trunk/README	Sat Jun 18 22:46:13 2005
@@ -1,5 +1,5 @@
-README for libdebtags1 1.0.3
-============================
+README for libdebtags1 1.0.4, still unreleased
+==============================================
 
 Functionality
 -------------

Modified: libdebtags1/trunk/configure.ac
==============================================================================
--- libdebtags1/trunk/configure.ac	(original)
+++ libdebtags1/trunk/configure.ac	Sat Jun 18 22:46:13 2005
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT(libdebtags1, 1.0.3, [enrico@debian.org])
+AC_INIT(libdebtags1, 1.0.4, [enrico@debian.org])
 AC_CONFIG_SRCDIR([configure.ac])
 AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(config.h)

Modified: libdebtags1/trunk/debian/changelog
==============================================================================
--- libdebtags1/trunk/debian/changelog	(original)
+++ libdebtags1/trunk/debian/changelog	Sat Jun 18 22:46:13 2005
@@ -1,3 +1,9 @@
+libdebtags1 (1.0.4) experimental; urgency=low
+
+  * Ported to new features of libtagcoll1.
+
+ -- Enrico Zini <enrico@debian.org>  Sun, 19 Jun 2005 00:45:44 +0200
+
 libdebtags1 (1.0.3) experimental; urgency=low
 
   * Fixed build-dependencies.  Closes: #309534.

Modified: libdebtags1/trunk/debtags/TagDB.cc
==============================================================================
--- libdebtags1/trunk/debtags/TagDB.cc	(original)
+++ libdebtags1/trunk/debtags/TagDB.cc	Sat Jun 18 22:46:13 2005
@@ -223,8 +223,9 @@
 template<class ITEM>
 TagDB<ITEM>::TagDB(const Vocabulary& voc, Tagcoll::Serializer<ITEM, Tag>& ser, bool editable)
 	throw (SystemException, ConsistencyCheckException)
-	: TDBReadonlyDiskIndex<ITEM, Tag>(Paths::path_tagdb_index, ser),
-			voc(voc)
+	: TDBReadonlyDiskIndex<ITEM, Tag>(
+			string(Paths::path_tagdb_index) + "pkg",
+			string(Paths::path_tagdb_index) + "tag", ser), voc(voc)
 {
 	if (rcdir.empty())
 		init_rcdir(editable);

Modified: libdebtags1/trunk/debtags/Update.cc
==============================================================================
--- libdebtags1/trunk/debtags/Update.cc	(original)
+++ libdebtags1/trunk/debtags/Update.cc	Sat Jun 18 22:46:13 2005
@@ -617,9 +617,11 @@
 	
 	// Output the merged collection to the target file
 	string tagdb = Debtags::Paths::path_tagdb;
-	string tagdbidx = Debtags::Paths::path_tagdb_index;
+	string tagdbpkgidx = string(Debtags::Paths::path_tagdb_index) + "pkg";
+	string tagdbtagidx = string(Debtags::Paths::path_tagdb_index) + "tag";
 	string tmpdb = tagdb + ".tmp";
-	string tmpdbidx = tagdbidx + ".tmp";
+	string tmpdbpkgidx = tagdbpkgidx + ".tmp";
+	string tmpdbtagidx = tagdbtagidx + ".tmp";
 	FILE* out = fopen(tmpdb.c_str(), "wt");
 	if (!out) throw FileException(errno, "opening " + tmpdb);
 	Serializer<string, string> serializer;
@@ -632,14 +634,16 @@
 	{
 		TDBIndexer<string, string> index(serializer);
 		grouper.output(index);
-		index.writeIndex(tmpdbidx);
+		index.writeIndex(tmpdbpkgidx, tmpdbtagidx);
 	}
 
 	// Perform atomic update of the tag database
 	if (rename(tmpdb.c_str(), tagdb.c_str()) == -1)
 		throw FileException(errno, "renaming " + tmpdb + " to " + tagdb);
-	if (rename(tmpdbidx.c_str(), tagdbidx.c_str()) == -1)
-		throw FileException(errno, "renaming " + tmpdbidx + " to " + tagdbidx);
+	if (rename(tmpdbpkgidx.c_str(), tagdbpkgidx.c_str()) == -1)
+		throw FileException(errno, "renaming " + tmpdbpkgidx + " to " + tagdbpkgidx);
+	if (rename(tmpdbtagidx.c_str(), tagdbtagidx.c_str()) == -1)
+		throw FileException(errno, "renaming " + tmpdbtagidx + " to " + tagdbtagidx);
 	if (rename(tmpvocfname.c_str(), vocfname.c_str()) == -1)
 		throw FileException(errno, "renaming " + tmpvocfname + " to " + vocfname);
 	if (rename(tmpvocidxfname.c_str(), vocidxfname.c_str()) == -1)