From owner-svn-soc-all@FreeBSD.ORG Tue Aug 20 19:23:56 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B50E1C7E for ; Tue, 20 Aug 2013 19:23:56 +0000 (UTC) (envelope-from mattbw@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A19F72632 for ; Tue, 20 Aug 2013 19:23:56 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KJNujD065930 for ; Tue, 20 Aug 2013 19:23:56 GMT (envelope-from mattbw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r7KJNuNl065925 for svn-soc-all@FreeBSD.org; Tue, 20 Aug 2013 19:23:56 GMT (envelope-from mattbw@FreeBSD.org) Date: Tue, 20 Aug 2013 19:23:56 GMT Message-Id: <201308201923.r7KJNuNl065925@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mattbw@FreeBSD.org using -f From: mattbw@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r256216 - soc2013/mattbw/backend/query MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 19:23:56 -0000 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) @@ -26,8 +26,6 @@ #include "match.h" /* query_match_... */ - - /* * Runs a query over the PackageIDs selected in the backend that sends the * first match to an emitting function. @@ -36,17 +34,24 @@ 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; }