From owner-svn-soc-all@FreeBSD.ORG Sun Aug 11 09:38:41 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 BCDF1F58 for ; Sun, 11 Aug 2013 09:38:41 +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 A98AB2C36 for ; Sun, 11 Aug 2013 09:38:41 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7B9cfwF067522 for ; Sun, 11 Aug 2013 09:38:41 GMT (envelope-from mattbw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r7B9cf42067517 for svn-soc-all@FreeBSD.org; Sun, 11 Aug 2013 09:38:41 GMT (envelope-from mattbw@FreeBSD.org) Date: Sun, 11 Aug 2013 09:38:41 GMT Message-Id: <201308110938.r7B9cf42067517@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: r255802 - soc2013/mattbw/backend 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: Sun, 11 Aug 2013 09:38:41 -0000 Author: mattbw Date: Sun Aug 11 09:38:41 2013 New Revision: 255802 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=255802 Log: Use type_of_repo_name in jobs. This fixes a bug whereby the job repository being '' would break the set-repository-of-jobs code. Testing shows that the new error messages aren't working, so more creativity is required. Modified: soc2013/mattbw/backend/jobs.c Modified: soc2013/mattbw/backend/jobs.c ============================================================================== --- soc2013/mattbw/backend/jobs.c Sun Aug 11 09:30:46 2013 (r255801) +++ soc2013/mattbw/backend/jobs.c Sun Aug 11 09:38:41 2013 (r255802) @@ -29,7 +29,7 @@ #include "db.h" /* db_... */ #include "event.h" /* event_cb */ -#include "utils.h" /* ERR */ +#include "utils.h" /* ERR, type_of_repo_name */ #include "jobs.h" /* jobs_... */ #include "jobs/check.h" /* jobs_check_... */ #include "pkgutils.h" /* pkgutils_... */ @@ -79,22 +79,19 @@ bool jobs_set_repo(struct pkg_jobs *jobs, const char *reponame) { - bool is_remote; bool success; - success = true; + assert(jobs != NULL); - is_remote = (reponame != NULL && strcmp(reponame, "installed") != 0); + success = true; - if (is_remote) { + if (type_of_repo_name(reponame) == REPO_REMOTE) { int err; err = pkg_jobs_set_repository(jobs, reponame); success = (err == EPKG_OK); } - assert(is_remote || success == true); - return success; }