[Debtags-commits] [svn] r2204 - in daemon: . src

Enrico Zini enrico at alioth.debian.org
Sun Dec 3 20:11:39 CET 2006


Author: enrico
Date: Sun Dec  3 20:11:39 2006
New Revision: 2204

Modified:
   daemon/   (props changed)
   daemon/src/cmdline.h
   daemon/src/config.cpp
   daemon/src/config.h
   daemon/src/debtagsd.cpp
Log:
 r3809 at viaza:  enrico | 2006-12-03 18:13:34 +0000
 Implemented MAINT to query the packages for a maintainer


Modified: daemon/src/cmdline.h
==============================================================================
--- daemon/src/cmdline.h	(original)
+++ daemon/src/cmdline.h	Sun Dec  3 20:11:39 2006
@@ -41,6 +41,7 @@
 	StringOption* pidfile;
 	StringOption* ftsdb;
 	StringOption* tagdb;
+	StringOption* maintdb;
 	StringOption* vocabulary;
 	StringOption* pkgdb;
 	StringOption* popcondb;
@@ -78,6 +79,8 @@
 				"pathname of the Xapian index of package descriptions");
 		tagdb = startOpts->add<StringOption>("tagdb", 0, "tagdb", "pathname",
 				"pathname of the plaintext tag database");
+		maintdb = startOpts->add<StringOption>("maintdb", 0, "maintdb", "pathname",
+				"pathname of the plaintext maintainer database");
 		vocabulary = startOpts->add<StringOption>("vocabulary", 0, "vocabulary", "pathname",
 				"pathname of the plaintext vocabulary file");
 		pkgdb = startOpts->add<StringOption>("pkgdb", 0, "pkgdb", "pathname",

Modified: daemon/src/config.cpp
==============================================================================
--- daemon/src/config.cpp	(original)
+++ daemon/src/config.cpp	Sun Dec  3 20:11:39 2006
@@ -50,6 +50,8 @@
 		ftsdb = opts.ftsdb->stringValue();
 	if (opts.tagdb->boolValue())
 		tagdb = opts.tagdb->stringValue();
+	if (opts.maintdb->boolValue())
+		maintdb = opts.maintdb->stringValue();
 	if (opts.vocabulary->boolValue())
 		vocabulary = opts.vocabulary->stringValue();
 	if (opts.pkgdb->boolValue())

Modified: daemon/src/config.h
==============================================================================
--- daemon/src/config.h	(original)
+++ daemon/src/config.h	Sun Dec  3 20:11:39 2006
@@ -16,6 +16,7 @@
 	std::string sockfile;
 	std::string ftsdb;
 	std::string tagdb;
+	std::string maintdb;
 	std::string vocabulary;
 	std::string pkgdb;
 	std::string popcondb;
@@ -32,6 +33,7 @@
 		  sockfile("/var/run/debtagsd/debtagsd.sock"),
 		  ftsdb("/var/lib/debtags/fts"),
 		  tagdb("/var/lib/debtags/package-tags"),
+		  maintdb("/var/lib/debtags/maintainers"),
 		  vocabulary("/var/lib/debtags/vocabulary"),
 		  pkgdb("/var/lib/dpkg/available"),
 		  popcondb("/var/lib/debtags/popcon"),

Modified: daemon/src/debtagsd.cpp
==============================================================================
--- daemon/src/debtagsd.cpp	(original)
+++ daemon/src/debtagsd.cpp	Sun Dec  3 20:11:39 2006
@@ -331,6 +331,8 @@
 	Config& cfg;
 
 	tagcoll::coll::Fast<std::string, std::string> coll;
+	// item: package -> tag: email address
+	tagcoll::coll::Fast<std::string, std::string> maints;
 	Descs desc;
 	Popcon popcon;
 	Tags tags;
@@ -403,6 +405,18 @@
 						i != pkgs.end(); ++i)
 					outputPackage(*i, conn);
 			}
+			else if (cmd == "MAINT")
+			{
+				set<string> pkgs;
+				if (!line.empty())
+					pkgs = maints.getItemsHavingTag(line);
+				for (set<string>::const_iterator i = pkgs.begin();
+						i != pkgs.end(); ++i)
+				{
+					if (!desc.has(*i)) continue;
+					outputPackage(*i, conn);
+				}
+			}
 			else if (cmd == "UNT")
 			{
 				// Read the maximum number of tags allowed per package (default to 0)
@@ -673,6 +687,11 @@
 			}
 		// Alternative: strip special::not-yet-tagged
 		//tagcoll::textformat::parse(input, tagcoll::stream::filterTagsByExpression("!special::not-yet-tagged*", tagcoll::coll::inserter(coll)));
+
+		// Read the maintainer database
+		tagcoll::input::Stdio inputm(cfg.maintdb);
+		tagcoll::textformat::parse(inputm, tagcoll::coll::inserter(maints));
+
 		// TODO: read in all the saved patches, sorted by filename
 	}
 



More information about the Debtags-commits mailing list