From owner-svn-soc-all@FreeBSD.ORG Mon Sep 2 08:50:50 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 92F7EEB0 for ; Mon, 2 Sep 2013 08:50:50 +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 8098A28AB for ; Mon, 2 Sep 2013 08:50:50 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r828ootF009661 for ; Mon, 2 Sep 2013 08:50:50 GMT (envelope-from mattbw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r828ooxG009643 for svn-soc-all@FreeBSD.org; Mon, 2 Sep 2013 08:50:50 GMT (envelope-from mattbw@FreeBSD.org) Date: Mon, 2 Sep 2013 08:50:50 GMT Message-Id: <201309020850.r828ooxG009643@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: r256826 - soc2013/mattbw/backend/jobs 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: Mon, 02 Sep 2013 08:50:50 -0000 Author: mattbw Date: Mon Sep 2 08:50:50 2013 New Revision: 256826 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=256826 Log: Use ident when setting pkgng job repo. The above case does not work when repository names are given; they must be idents. Modified: soc2013/mattbw/backend/jobs/do.c Modified: soc2013/mattbw/backend/jobs/do.c ============================================================================== --- soc2013/mattbw/backend/jobs/do.c Mon Sep 2 08:00:12 2013 (r256825) +++ soc2013/mattbw/backend/jobs/do.c Mon Sep 2 08:50:50 2013 (r256826) @@ -49,10 +49,8 @@ jobs_do(const struct jobs_spec *spec) { bool success; - struct pkgdb *db; - assert(spec != NULL); assert(spec->backend != NULL); assert(spec->info != NULL); @@ -172,10 +170,11 @@ /* Nastily inefficient */ splits = pk_package_id_split(package_ids[i]); - if (splits == NULL) + if (splits == NULL) { repo = strdup(""); - else + } else { repo = strdup(splits[PK_PACKAGE_ID_DATA]); + } g_strfreev(splits); success = jobs_do_same_repo(db, spec, package_ids + i, @@ -242,12 +241,22 @@ const char *reponame) { bool success; + struct pkg_repo *repo; assert(spec != NULL); assert(jobs != NULL); /* reponame can be NULL */ - success = jobs_set_repo(jobs, reponame); + success = true; + + /* + * We need to convert the repo name to an ident. This is the only + * place an ident works but a name doesn't, it seems. + */ + repo = pkg_repo_find_name(reponame); + if (repo != NULL) { + success = jobs_set_repo(jobs, pkg_repo_ident(repo)); + } if (!success) { char *err_message;