From e2fd21015aeedba1a9936f46b185c41047ee034d Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Sun, 14 Dec 2008 23:21:21 -0500 Subject: opkg: add downloading, configuring and installing state changes git-svn-id: http://opkg.googlecode.com/svn/trunk@27 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'opkg_download.c') diff --git a/opkg_download.c b/opkg_download.c index c3fa44c..2bdbb00 100644 --- a/opkg_download.c +++ b/opkg_download.c @@ -201,6 +201,7 @@ int opkg_download_pkg(opkg_conf_t *conf, pkg_t *pkg, const char *dir) { int err; char *url; + char *pkgid; if (pkg->src == NULL) { opkg_message(conf,OPKG_ERROR, "ERROR: Package %s (parent %s) is not available from any configured src.\n", @@ -208,6 +209,10 @@ int opkg_download_pkg(opkg_conf_t *conf, pkg_t *pkg, const char *dir) return -1; } + sprintf_alloc (&pkgid, "%s;%s;%s;", pkg->name, pkg->version, pkg->architecture); + opkg_set_current_state (OPKG_STATE_DOWNLOADING_PKG, pkgid); + free (pkgid); + sprintf_alloc(&url, "%s/%s", pkg->src->value, pkg->filename); /* XXX: BUG: The pkg->filename might be something like @@ -219,6 +224,7 @@ int opkg_download_pkg(opkg_conf_t *conf, pkg_t *pkg, const char *dir) err = opkg_download(conf, url, pkg->local_filename); free(url); + opkg_set_current_state (OPKG_STATE_NONE, NULL); return err; } -- cgit v0.9.1