socsvn commit: r256216 - soc2013/mattbw/backend/query

From: <mattbw_at_FreeBSD.org>
Date: Tue, 20 Aug 2013 19:23:56 GMT
Author: mattbw
Date: Tue Aug 20 19:23:56 2013
New Revision: 256216
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=256216

Log:
  (Still broken) Start on the replacement for the emitter-based query flow.
  
  This doesn't do anything yet, but I've sketched out where the new ID
  transformation would occur.  Further work to be done this week.
  

Modified:
  soc2013/mattbw/backend/query/match.c

Modified: soc2013/mattbw/backend/query/match.c
==============================================================================
--- soc2013/mattbw/backend/query/match.c	Tue Aug 20 18:22:04 2013	(r256215)
+++ soc2013/mattbw/backend/query/match.c	Tue Aug 20 19:23:56 2013	(r256216)
_at__at_ -26,8 +26,6 _at__at_
 #include "match.h"		/* query_match_... */
 
 
-
-
 /*
  * Runs a query over the PackageIDs selected in the backend that sends the
  * first match to an emitting function.
_at__at_ -36,17 +34,24 _at__at_
 query_match_id_to_emitter(PkBackend *backend, unsigned int load_flags,
     emit_ptr emitter)
 {
-	struct query_source s;
-	struct query_target t;
-
-	s.unused = true;
-	s.position = 0;
-	s.total = 1;
-	s.type = QUERY_BACKEND_IDS;
-
-	t.f = emitter;
-	t.load_flags = load_flags;
-	t.error_if_not_found = true;
+	bool		success;
+	guint		count;
+	gchar	      **package_ids;
+	struct query_id *query_ids;
+
+	assert(backend != NULL);
+	assert(emitter != NULL);
+
+	success = false;
+
+	package_ids = pk_backend_get_strv("package_ids");
+	assert(package_ids != NULL);
+	count = g_strv_length(package_ids);
+
+	query_ids = query_id_array_from_package_ids(package_ids, count);
+	if (query_ids != NULL) {
+		/* More stuff here */
+	}
 
-	return query_do(backend, &s, &t);
+	return success;
 }
Received on Tue Aug 20 2013 - 19:23:56 UTC