From owner-svn-soc-all@FreeBSD.ORG Mon Sep 2 19:28:45 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 60E5D1F4 for ; Mon, 2 Sep 2013 19:28:45 +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 2BEA82CCE for ; Mon, 2 Sep 2013 19:28:45 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r82JSjQF064156 for ; Mon, 2 Sep 2013 19:28:45 GMT (envelope-from mattbw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r82JSjJM064153 for svn-soc-all@FreeBSD.org; Mon, 2 Sep 2013 19:28:45 GMT (envelope-from mattbw@FreeBSD.org) Date: Mon, 2 Sep 2013 19:28:45 GMT Message-Id: <201309021928.r82JSjJM064153@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: r256843 - in 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 19:28:45 -0000 Author: mattbw Date: Mon Sep 2 19:28:44 2013 New Revision: 256843 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=256843 Log: Make repository validation work- ish. This seems to work better than it did before this commit, but the jobs are still trying to match packages from other repositories. Modified: soc2013/mattbw/backend/jobs/do.c soc2013/mattbw/backend/utils.c Modified: soc2013/mattbw/backend/jobs/do.c ============================================================================== --- soc2013/mattbw/backend/jobs/do.c Mon Sep 2 19:03:40 2013 (r256842) +++ soc2013/mattbw/backend/jobs/do.c Mon Sep 2 19:28:44 2013 (r256843) @@ -259,15 +259,29 @@ assert(jobs != NULL); /* reponame can be NULL */ - success = true; + success = false; + repo = NULL; /* * 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)); + switch(type_of_repo_name(reponame)) { + case REPO_REMOTE: + success = jobs_set_repo(jobs, + pkg_repo_ident_from_name(reponame)); + break; + case REPO_LOCAL: + case REPO_ANY: + /* + * No need to set the repository name; we're either dealing + * with a local package or a wildcard-repo one. + */ + success = true; + break; + case REPO_INVALID: + success = false; + break; } if (!success) { char *err_message; Modified: soc2013/mattbw/backend/utils.c ============================================================================== --- soc2013/mattbw/backend/utils.c Mon Sep 2 19:03:40 2013 (r256842) +++ soc2013/mattbw/backend/utils.c Mon Sep 2 19:28:44 2013 (r256843) @@ -42,7 +42,8 @@ rtype = REPO_ANY; } else if (strcmp(name, "installed") == 0) { rtype = REPO_LOCAL; - } else if (pkg_repo_find_name(name) != NULL) { + } else if (pkg_repo_find_ident(pkg_repo_ident_from_name(name)) + != NULL) { rtype = REPO_REMOTE; } else { rtype = REPO_INVALID;