General Public License for more details.
*/
-#include "config.h"
-
#include <stdio.h>
#include <unistd.h>
#include <fnmatch.h>
if (opkg_conf_load())
goto err0;
- if (pkg_hash_load_feeds())
+ if (pkg_hash_load_feeds(0))
goto err1;
if (pkg_hash_load_status_files())
void *user_data)
{
int err;
- char *stripped_filename;
+ char *stripped_filename, *local_filename;
opkg_progress_data_t pdata;
pkg_t *old, *new;
pkg_vec_t *deps, *all;
int i, ndepends;
char **unresolved = NULL;
+ const char *filename;
opkg_assert(package_name != NULL);
char *url;
pkg = deps->pkgs[i];
- if (pkg->local_filename)
+ if (pkg_get_string(pkg, PKG_LOCAL_FILENAME))
continue;
pdata.pkg = pkg;
return -1;
}
- sprintf_alloc(&url, "%s/%s", pkg->src->value, pkg->filename);
+ filename = pkg_get_string(pkg, PKG_FILENAME);
+
+ sprintf_alloc(&url, "%s/%s", pkg->src->value, filename);
/* Get the filename part, without any directory */
- stripped_filename = strrchr(pkg->filename, '/');
+ stripped_filename = strrchr(filename, '/');
if (!stripped_filename)
- stripped_filename = pkg->filename;
+ stripped_filename = (char *)filename;
- sprintf_alloc(&pkg->local_filename, "%s/%s", conf->tmp_dir,
+ sprintf_alloc(&local_filename, "%s/%s", conf->tmp_dir,
stripped_filename);
+ pkg_set_string(pkg, PKG_LOCAL_FILENAME, local_filename);
+
cb_data.cb = progress_callback;
cb_data.progress_data = &pdata;
cb_data.user_data = user_data;
cb_data.start_range = 75 * i / deps->len;
cb_data.finish_range = 75 * (i + 1) / deps->len;
- err = opkg_download(url, pkg->local_filename,
+ err = opkg_download(url, local_filename,
(curl_progress_func) curl_progress_cb,
&cb_data, 0);
free(url);
}
free(url);
-#if defined(HAVE_GPGME) || defined(HAVE_OPENSSL) || defined(HAVE_USIGN)
+#if defined(HAVE_OPENSSL) || defined(HAVE_USIGN)
if (conf->check_signature) {
char *sig_file_name;
/* download detached signitures to verify the package lists */
head = prepare_upgrade_list();
for (node = active_list_next(head, head); node;
node = active_list_next(head, node)) {
- old = list_entry(node, pkg_t, list);
+ old = node->pkg;
new =
pkg_hash_fetch_best_installation_candidate_by_name(old->
name);
/* check architecture */
if (arch) {
- if (sstrcmp(pkg->architecture, arch))
+ if (sstrcmp(pkg_get_architecture(pkg), arch))
continue;
}