socsvn commit: r256844 - in soc2013/mattbw/backend: . jobs

mattbw at FreeBSD.org mattbw at FreeBSD.org
Mon Sep 2 19:37:55 UTC 2013


Author: mattbw
Date: Mon Sep  2 19:37:55 2013
New Revision: 256844
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=256844

Log:
  Fix job repo suitability check issue.
  
  This was mainly due to forgetting there was another layer between
  jobs_do_set_repo and the actual repo setter, with most of the checks I was
  writing being duplicated across do_set_repo and set_repo.  As such the
  checks in the latter failed due to expecting a name instead of an ident,
  and things broke spectacularly.
  

Modified:
  soc2013/mattbw/backend/jobs.c
  soc2013/mattbw/backend/jobs/do.c

Modified: soc2013/mattbw/backend/jobs.c
==============================================================================
--- soc2013/mattbw/backend/jobs.c	Mon Sep  2 19:28:44 2013	(r256843)
+++ soc2013/mattbw/backend/jobs.c	Mon Sep  2 19:37:55 2013	(r256844)
@@ -89,15 +89,20 @@
 jobs_set_repo(struct pkg_jobs *jobs, const char *reponame)
 {
 	bool		success;
+	enum repo_type  type;
 
 	assert(jobs != NULL);
 
 	success = true;
 
-	if (type_of_repo_name(reponame) == REPO_REMOTE) {
+	type = type_of_repo_name(reponame);
+	if (type == REPO_INVALID) {
+		success = false;
+	} else if (type == REPO_REMOTE) {
 		int		err;
 
-		err = pkg_jobs_set_repository(jobs, reponame);
+		err = pkg_jobs_set_repository(jobs,
+		    pkg_repo_ident_from_name(reponame));
 		success = (err == EPKG_OK);
 	}
 

Modified: soc2013/mattbw/backend/jobs/do.c
==============================================================================
--- soc2013/mattbw/backend/jobs/do.c	Mon Sep  2 19:28:44 2013	(r256843)
+++ soc2013/mattbw/backend/jobs/do.c	Mon Sep  2 19:37:55 2013	(r256844)
@@ -253,36 +253,12 @@
     const char *reponame)
 {
 	bool		success;
-	struct pkg_repo *repo;
 
 	assert(spec != NULL);
 	assert(jobs != NULL);
 	/* reponame can be NULL */
 
-	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.
-	 */
-	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;
-	}
+	success = jobs_set_repo(jobs, reponame);
 	if (!success) {
 		char	       *err_message;
 


More information about the svn-soc-all mailing list