index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-04-21 18:31:19 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-04-22 17:08:33 -0500 |
commit | 9579879b1bb1a033e846b750769215b7b4066073 (patch) | |
tree | 9d41d9c12914e72f6a900ac152c1f520d003f8d1 /lib/libalpm/sync.c | |
parent | 204bbc47149c948b680735a933fa395ce3983f38 (diff) |
-rw-r--r-- | lib/libalpm/sync.c | 25 |
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 63ea2b2d..4ce62e64 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -689,8 +689,8 @@ static int test_md5sum(pmtrans_t *trans, const char *filepath, int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) { - alpm_list_t *i, *j, *files = NULL; - alpm_list_t *deltas = NULL; + alpm_list_t *i, *j, *k; + alpm_list_t *files = NULL, *deltas = NULL; size_t numtargs, current = 0, replaces = 0; int errors = 0; const char *cachedir = NULL; @@ -758,7 +758,26 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) if(files) { EVENT(trans, PM_TRANS_EVT_RETRIEVE_START, current->treename, NULL); - errors = _alpm_download_files(files, current->servers, cachedir); + for(j = files; j; j = j->next) { + const char *filename = j->data; + for(k = current->servers; k; k = k->next) { + const char *server = k->data; + char *fileurl; + size_t len; + + /* print server + filename into a buffer */ + len = strlen(server) + strlen(filename) + 2; + CALLOC(fileurl, len, sizeof(char), RET_ERR(PM_ERR_MEMORY, -1)); + snprintf(fileurl, len, "%s/%s", server, filename); + + ret = _alpm_download(fileurl, cachedir, 0, 1, 0); + FREE(fileurl); + if(ret != -1) { + break; + } + errors++; + } + } if(errors) { _alpm_log(PM_LOG_WARNING, _("failed to retrieve some files from %s\n"), |