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) {
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;
}
/* 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 {
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);
}
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,
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,
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;
}
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;
}
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;
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;
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;
#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.