From 47657107af6bcfd2ef583b3014e9faffbb5d300e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 27 Sep 2011 07:53:38 -0500 Subject: Delay check for repository servers until we need them In the sync download code, we added an early check in 6731d0a9407e for sync download server existence so we wouldn't show the same error over and over for each file to be downloaded. Move this check into the download block so we only run it if there are actually files that need to be downloaded for this repository. Signed-off-by: Dan McGee --- lib/libalpm/sync.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index b6b84301..b1da6829 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -815,14 +815,6 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) for(i = handle->dbs_sync; i; i = i->next) { alpm_db_t *current = i->data; - if(!current->servers) { - handle->pm_errno = ALPM_ERR_SERVER_NONE; - _alpm_log(handle, ALPM_LOG_ERROR, "%s: %s\n", - alpm_strerror(handle->pm_errno), current->treename); - errors++; - continue; - } - for(j = handle->trans->add; j; j = j->next) { alpm_pkg_t *spkg = j->data; @@ -861,6 +853,14 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) } if(files) { + if(!current->servers) { + handle->pm_errno = ALPM_ERR_SERVER_NONE; + _alpm_log(handle, ALPM_LOG_ERROR, "%s: %s\n", + alpm_strerror(handle->pm_errno), current->treename); + errors++; + continue; + } + EVENT(handle, ALPM_EVENT_RETRIEVE_START, current->treename, NULL); for(j = files; j; j = j->next) { struct dload_payload *payload = j->data; -- cgit v1.2.3-24-g4f1b