summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-09-27 07:53:38 -0500
committerDan McGee <dan@archlinux.org>2011-09-27 07:53:38 -0500
commit47657107af6bcfd2ef583b3014e9faffbb5d300e (patch)
treecefc5bf1591af4b311a1773298690fe4e9ec5a56
parent5e13b2b6af7d0cb2cbb22d6090f731e74a64afa5 (diff)
downloadpacman-47657107af6bcfd2ef583b3014e9faffbb5d300e.tar.xz
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 <dan@archlinux.org>
-rw-r--r--lib/libalpm/sync.c16
1 files changed, 8 insertions, 8 deletions
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;