summaryrefslogtreecommitdiffstats
path: root/libopkg/opkg_download.c
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:29:12 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:29:12 (EST)
commit1f08c9e15caa6377c58f55c0fdaab8f4fab1ad5e (patch)
treea7a7ff99d0d5df5c5750ddb07664fcc4a31b3b6d /libopkg/opkg_download.c
parent1475a6802f47230c01cf4a37ee5a6686a4718f79 (diff)
opkg: only cache the packages
thanks Werner. git-svn-id: http://opkg.googlecode.com/svn/trunk@156 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 5dabeed..04073cf 100644
--- a/libopkg/opkg_download.c
+++ b/libopkg/opkg_download.c
@@ -33,7 +33,7 @@
#include "str_util.h"
#include "opkg_defines.h"
-static int do_download(opkg_conf_t *conf, const char *src,
+int opkg_download(opkg_conf_t *conf, const char *src,
const char *dest_file_name, curl_progress_func cb, void *data)
{
int err = 0;
@@ -136,7 +136,7 @@ static int do_download(opkg_conf_t *conf, const char *src,
return 0;
}
-int opkg_download(opkg_conf_t *conf, const char *src,
+static int opkg_download_cache(opkg_conf_t *conf, const char *src,
const char *dest_file_name, curl_progress_func cb, void *data)
{
char *cache_name = strdup(src);
@@ -144,7 +144,7 @@ int opkg_download(opkg_conf_t *conf, const char *src,
int err = 0;
if (!conf->cache || str_starts_with(src, "file:")) {
- err = do_download(conf, src, dest_file_name, cb, data);
+ err = opkg_download(conf, src, dest_file_name, cb, data);
goto out1;
}
@@ -156,7 +156,7 @@ int opkg_download(opkg_conf_t *conf, const char *src,
if (file_exists(cache_location))
opkg_message(conf, OPKG_NOTICE, "Copying %s\n", cache_location);
else {
- err = do_download(conf, src, cache_location, cb, data);
+ err = opkg_download(conf, src, cache_location, cb, data);
if (err) {
(void) unlink(cache_location);
goto out2;
@@ -203,7 +203,7 @@ int opkg_download_pkg(opkg_conf_t *conf, pkg_t *pkg, const char *dir)
sprintf_alloc(&pkg->local_filename, "%s/%s", dir, stripped_filename);
- err = opkg_download(conf, url, pkg->local_filename, NULL, NULL);
+ err = opkg_download_cache(conf, url, pkg->local_filename, NULL, NULL);
free(url);
opkg_set_current_state (conf, OPKG_STATE_NONE, NULL);