From: Jo-Philipp Wich Date: Wed, 15 Mar 2017 00:04:49 +0000 (+0100) Subject: libopkg: remove unused progress parameters from opkg_download() X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e450488296dcb20d93dd4f48ffd887f440ce17c8;p=oweals%2Fopkg-lede.git libopkg: remove unused progress parameters from opkg_download() Signed-off-by: Jo-Philipp Wich --- diff --git a/libopkg/opkg.c b/libopkg/opkg.c index f6a3892..d994bd1 100644 --- a/libopkg/opkg.c +++ b/libopkg/opkg.c @@ -289,7 +289,7 @@ opkg_install_package(const char *package_name, pkg_set_string(pkg, PKG_LOCAL_FILENAME, local_filename); - err = opkg_download(url, local_filename, NULL, NULL, 0); + err = opkg_download(url, local_filename, 0); free(url); if (err) { @@ -538,7 +538,7 @@ opkg_update_package_lists(opkg_progress_callback_t progress_callback, sprintf_alloc(&list_file_name, "%s/%s", lists_dir, src->name); - if (opkg_download(url, list_file_name, NULL, NULL, 0)) { + if (opkg_download(url, list_file_name, 0)) { opkg_msg(ERROR, "Couldn't retrieve %s\n", url); result = -1; } @@ -563,7 +563,7 @@ opkg_update_package_lists(opkg_progress_callback_t progress_callback, /* make sure there is no existing signature file */ unlink(sig_file_name); - err = opkg_download(url, sig_file_name, NULL, NULL, 0); + err = opkg_download(url, sig_file_name, 0); if (err) { opkg_msg(ERROR, "Couldn't retrieve %s\n", url); } else { @@ -767,7 +767,7 @@ int opkg_repository_accessibility_check(void) iter1 = str_list_pop(src); repositories--; - if (opkg_download(iter1->data, "/dev/null", NULL, NULL, 0)) + if (opkg_download(iter1->data, "/dev/null", 0)) ret++; str_list_elt_deinit(iter1); } diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c index 2ef2ff4..7d5bd04 100644 --- a/libopkg/opkg_cmd.c +++ b/libopkg/opkg_cmd.c @@ -130,7 +130,7 @@ static int opkg_update_cmd(int argc, char **argv) sprintf_alloc(&list_file_name, "%s/%s", lists_dir, src->name); pkglist_dl_error = 0; - if (opkg_download(url, list_file_name, NULL, NULL, 0)) { + if (opkg_download(url, list_file_name, 0)) { failures++; pkglist_dl_error = 1; opkg_msg(NOTICE, @@ -160,7 +160,7 @@ static int opkg_update_cmd(int argc, char **argv) sprintf_alloc(&tmp_file_name, "%s/%s.sig", lists_dir, src->name); - err = opkg_download(url, tmp_file_name, NULL, NULL, 0); + err = opkg_download(url, tmp_file_name, 0); if (err) { failures++; opkg_msg(NOTICE, diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c index 148d08b..db4c90f 100644 --- a/libopkg/opkg_download.c +++ b/libopkg/opkg_download.c @@ -38,7 +38,7 @@ static int str_starts_with(const char *str, const char *prefix) int opkg_download(const char *src, const char *dest_file_name, - curl_progress_func cb, void *data, const short hide_error) + const short hide_error) { int err = 0; @@ -122,15 +122,14 @@ opkg_download(const char *src, const char *dest_file_name, } static int -opkg_download_cache(const char *src, const char *dest_file_name, - curl_progress_func cb, void *data) +opkg_download_cache(const char *src, const char *dest_file_name) { char *cache_name = xstrdup(src); char *cache_location, *p; int err = 0; if (!conf->cache || str_starts_with(src, "file:")) { - err = opkg_download(src, dest_file_name, cb, data, 0); + err = opkg_download(src, dest_file_name, 0); goto out1; } @@ -161,7 +160,7 @@ opkg_download_cache(const char *src, const char *dest_file_name, if (file_exists(cache_location)) opkg_msg(NOTICE, "Copying %s.\n", cache_location); else { - err = opkg_download(src, cache_location, cb, data, 0); + err = opkg_download(src, cache_location, 0); if (err) { (void)unlink(cache_location); goto out2; @@ -216,7 +215,7 @@ int opkg_download_pkg(pkg_t * pkg, const char *dir) sprintf_alloc(&local_filename, "%s/%s", dir, stripped_filename); pkg_set_string(pkg, PKG_LOCAL_FILENAME, local_filename); - err = opkg_download_cache(url, local_filename, NULL, NULL); + err = opkg_download_cache(url, local_filename); free(url); return err; @@ -240,7 +239,7 @@ int opkg_prepare_url_for_install(const char *url, char **namep) char *file_base = basename(file_basec); sprintf_alloc(&tmp_file, "%s/%s", conf->tmp_dir, file_base); - err = opkg_download(url, tmp_file, NULL, NULL, 0); + err = opkg_download(url, tmp_file, 0); if (err) return err; diff --git a/libopkg/opkg_download.h b/libopkg/opkg_download.h index 7415cf3..fd260bc 100644 --- a/libopkg/opkg_download.h +++ b/libopkg/opkg_download.h @@ -20,12 +20,8 @@ #include "pkg.h" -typedef void (*opkg_download_progress_callback) (int percent, char *url); -typedef int (*curl_progress_func) (void *data, double t, double d, - double ultotal, double ulnow); - int opkg_download(const char *src, const char *dest_file_name, - curl_progress_func cb, void *data, const short hide_error); + const short hide_error); int opkg_download_pkg(pkg_t * pkg, const char *dir); /* * Downloads file from url, installs in package database, return package name.