projects
/
oweals
/
opkg-lede.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
opkg: only cache the packages
[oweals/opkg-lede.git]
/
libopkg
/
opkg_download.c
diff --git
a/libopkg/opkg_download.c
b/libopkg/opkg_download.c
index 5dabeed768cc5f10efd77fe3f9e2299206e439b7..04073cf593f3659acd6749d8c76cd6ac888b2fd7 100644
(file)
--- a/
libopkg/opkg_download.c
+++ b/
libopkg/opkg_download.c
@@
-33,7
+33,7
@@
#include "str_util.h"
#include "opkg_defines.h"
#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;
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;
}
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);
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:")) {
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;
}
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 {
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;
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);
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);
free(url);
opkg_set_current_state (conf, OPKG_STATE_NONE, NULL);