Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/be_sync.c
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-06-30 21:19:25 -0400
committerDave Reisner <dreisner@archlinux.org>2011-07-05 23:00:02 -0400
commit3eec745910bb908717a8b4ed7f5b630a92a5c9eb (patch)
treeb87189a8d755d7159d61d5ef6f00d9e1a456286f /lib/libalpm/be_sync.c
parent6dc71926f9b16ebcf11b924941092d6eab204224 (diff)
absorb some _alpm_download params into payload struct
Restore some sanity to the number of arguments passed to _alpm_download and curl_download_internal. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'lib/libalpm/be_sync.c')
-rw-r--r--lib/libalpm/be_sync.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index f681fc8e..d7e14ba3 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -185,8 +185,10 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
len = strlen(server) + strlen(db->treename) + 9;
CALLOC(payload->fileurl, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(payload->fileurl, len, "%s/%s.db", server, db->treename);
+ payload->handle = handle;
+ payload->force = force;
- ret = _alpm_download(handle, payload, syncpath, NULL, force, 0, 0);
+ ret = _alpm_download(payload, syncpath, NULL);
if(ret == 0 && (level & ALPM_SIG_DATABASE)) {
/* an existing sig file is no good at this point */
@@ -198,16 +200,18 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
unlink(sigpath);
free(sigpath);
- int errors_ok = (level & ALPM_SIG_DATABASE_OPTIONAL);
/* if we downloaded a DB, we want the .sig from the same server */
snprintf(payload->fileurl, len, "%s/%s.db.sig", server, db->treename);
+ payload->handle = handle;
+ payload->force = 1;
+ payload->errors_ok = (level & ALPM_SIG_DATABASE_OPTIONAL);
/* set hard upper limit of 16KiB */
payload->max_size = 16 * 1024;
- sig_ret = _alpm_download(handle, payload, syncpath, NULL, 1, 0, errors_ok);
+ sig_ret = _alpm_download(payload, syncpath, NULL);
/* errors_ok suppresses error messages, but not the return code */
- sig_ret = errors_ok ? 0 : sig_ret;
+ sig_ret = payload->errors_ok ? 0 : sig_ret;
}
_alpm_dload_payload_free(payload);