summaryrefslogtreecommitdiffstats
path: root/libopkg/opkg_download.c
diff options
context:
space:
mode:
authorjaviplx@gmail.com <javiplx@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2011-04-07 11:03:54 (EDT)
committer javiplx@gmail.com <javiplx@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2011-04-07 11:03:54 (EDT)
commitb427dfbf01c2f8fb8908a28bccbefd1fc1c6595c (patch)
tree7514c91b4e24ee57b2e3e3d86cffae237679a390 /libopkg/opkg_download.c
parentb71b378dc4580dc8773d8b065c2dbc4f9e701028 (diff)
Add flag in opkg_download calls to reduce the severity of the 'failed download' message
git-svn-id: http://opkg.googlecode.com/svn/trunk@610 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/opkg_download.c')
-rw-r--r--libopkg/opkg_download.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c
index 16502d1..b9533aa 100644
--- a/libopkg/opkg_download.c
+++ b/libopkg/opkg_download.c
@@ -82,7 +82,7 @@ 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)
+ curl_progress_func cb, void *data, const short hide_error)
{
int err = 0;
@@ -142,7 +142,7 @@ opkg_download(const char *src, const char *dest_file_name,
{
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;
@@ -196,7 +196,7 @@ opkg_download_cache(const char *src, const char *dest_file_name,
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;
}
@@ -215,7 +215,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);
+ err = opkg_download(src, cache_location, cb, data, 0);
if (err) {
(void) unlink(cache_location);
goto out2;
@@ -287,7 +287,7 @@ 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);
+ err = opkg_download(url, tmp_file, NULL, NULL, 0);
if (err)
return err;