Date: Sun, 11 Aug 2013 09:38:41 GMT From: mattbw@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r255802 - soc2013/mattbw/backend Message-ID: <201308110938.r7B9cf42067517@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308110938.r7B9cf42067517>