From aa1c0ba9f8787fc3b1a1190103e394b0c1c95922 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 20 Nov 2006 09:10:23 +0000 Subject: * repo-add script - to add entries to a db file directly from package data (no PKGBUILD) * libalpm api changes - move from a _getinfo(p, WHAT_WE_WANT) scheme to a typesafe _get_what_we_want(p) scheme [not 100% complete yet] * some const correctness changes * removal of PM_* types in alpm.h in favor of the pm*_t types used throughout libalpm --- lib/libalpm/server.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/libalpm/server.c') diff --git a/lib/libalpm/server.c b/lib/libalpm/server.c index 4c0b5e79..90466e32 100644 --- a/lib/libalpm/server.c +++ b/lib/libalpm/server.c @@ -38,8 +38,6 @@ #include "handle.h" #include "log.h" -download_progress_cb pm_dlcb = NULL; - pmserver_t *_alpm_server_new(const char *url) { struct url *u; @@ -172,10 +170,10 @@ int _alpm_downloadfiles_forreal(pmlist_t *servers, const char *localpath, downloadTimeout = 10000; /* Make libdownload super verbose... worthwhile for testing */ - if(pm_logmask & PM_LOG_DOWNLOAD) { + if(alpm_option_get_logmask() & PM_LOG_DOWNLOAD) { downloadDebug = 1; } - if(pm_logmask & PM_LOG_DEBUG) { + if(alpm_option_get_logmask() & PM_LOG_DEBUG) { dlf = downloadXGet(server->s_url, &ust, (handle->nopassiveftp ? "v" : "vp")); } else { dlf = downloadXGet(server->s_url, &ust, (handle->nopassiveftp ? "" : "p")); @@ -229,7 +227,7 @@ int _alpm_downloadfiles_forreal(pmlist_t *servers, const char *localpath, } /* Progress 0 - initialize */ - if(pm_dlcb) pm_dlcb(fn, 0, ust.size); + if(handle->dlcb) handle->dlcb(fn, 0, ust.size); int nread = 0; char buffer[PM_DLBUF_LEN]; @@ -238,7 +236,7 @@ int _alpm_downloadfiles_forreal(pmlist_t *servers, const char *localpath, while((nwritten += fwrite(buffer, 1, (nread - nwritten), localf)) < nread) ; dltotal_bytes += nread; - if(pm_dlcb) pm_dlcb(fn, dltotal_bytes, ust.size); + if(handle->dlcb) handle->dlcb(fn, dltotal_bytes, ust.size); } fclose(localf); -- cgit v1.2.3