err = opkg_download(url, pkg->local_filename,
(curl_progress_func) curl_progress_cb,
- &cb_data);
+ &cb_data, 0);
free(url);
if (err) {
err = opkg_download(url, tmp_file_name,
(curl_progress_func) curl_progress_cb,
- &cb_data);
+ &cb_data, 0);
if (err == 0) {
opkg_msg(INFO, "Inflating %s...\n",
}
free(tmp_file_name);
} else
- err = opkg_download(url, list_file_name, NULL, NULL);
+ err = opkg_download(url, list_file_name, NULL, NULL, 0);
if (err) {
opkg_msg(ERROR, "Couldn't retrieve %s\n", url);
/* make sure there is no existing signature file */
unlink(sig_file_name);
- err = opkg_download(url, sig_file_name, NULL, NULL);
+ err = opkg_download(url, sig_file_name, NULL, NULL, 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))
+ if (opkg_download(iter1->data, "/dev/null", NULL, NULL, 0))
ret++;
str_list_elt_deinit(iter1);
}
FILE *in, *out;
sprintf_alloc (&tmp_file_name, "%s/%s.gz", tmp, src->name);
- err = opkg_download(url, tmp_file_name, NULL, NULL);
+ err = opkg_download(url, tmp_file_name, NULL, NULL, 0);
if (err == 0) {
opkg_msg(NOTICE, "Inflating %s.\n", url);
in = fopen (tmp_file_name, "r");
}
free(tmp_file_name);
} else
- err = opkg_download(url, list_file_name, NULL, NULL);
+ err = opkg_download(url, list_file_name, NULL, NULL, 0);
if (err) {
failures++;
} else {
/* Put the signature in the right place */
sprintf_alloc (&tmp_file_name, "%s/%s.sig", lists_dir, src->name);
- err = opkg_download(url, tmp_file_name, NULL, NULL);
+ err = opkg_download(url, tmp_file_name, NULL, NULL, 0);
if (err) {
failures++;
opkg_msg(NOTICE, "Signature check failed.\n");
int
opkg_download(const char *src, const char *dest_file_name,
- curl_progress_func cb, void *data)
+ curl_progress_func cb, void *data, const short hide_error)
{
int err = 0;
{
long error_code;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &error_code);
- opkg_msg(ERROR, "Failed to download %s: %s.\n",
+ opkg_msg(hide_error?DEBUG2:ERROR, "Failed to download %s: %s.\n",
src, curl_easy_strerror(res));
free(tmp_file_location);
return -1;
int err = 0;
if (!conf->cache || str_starts_with(src, "file:")) {
- err = opkg_download(src, dest_file_name, cb, data);
+ err = opkg_download(src, dest_file_name, cb, data, 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);
+ err = opkg_download(src, cache_location, cb, data, 0);
if (err) {
(void) unlink(cache_location);
goto out2;
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);
+ err = opkg_download(url, tmp_file, NULL, NULL, 0);
if (err)
return err;
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);
+int opkg_download(const char *src, const char *dest_file_name, curl_progress_func cb, void *data, 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.