libopkg: remove unused progress parameters from opkg_download()
authorJo-Philipp Wich <jo@mein.io>
Wed, 15 Mar 2017 00:04:49 +0000 (01:04 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 15 Mar 2017 00:42:49 +0000 (01:42 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libopkg/opkg.c
libopkg/opkg_cmd.c
libopkg/opkg_download.c
libopkg/opkg_download.h

index f6a38923c1ec11007950a71996486cef594abfa4..d994bd19888c98aa6e95fbcb1d29b94bad17d1bc 100644 (file)
@@ -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);
        }
index 2ef2ff4a5b6b47531afbd8438cd0a2e512f00219..7d5bd04a8d45f06c7f3a9ee064eb24581249c755 100644 (file)
@@ -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,
index 148d08bb6b0861eb5c9427ba100d2a8c6850dcd2..db4c90f2a69b81ca2a1d2fa52187471822ae3443 100644 (file)
@@ -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;
 
index 7415cf3d2c060b02f5985f14e4294472688e817e..fd260bc35aa97a2bde34c58eef2e349b22f568ea 100644 (file)
 
 #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.