summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:19:40 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:19:40 (EST)
commitf8cdd15eccf818a39d07beb2a08114f6cf9e402b (patch)
treec454b860708cf717177d9dceb342cc35c61165cf
parent6e5ac111a68f68c28e973719154a0acfdbeaf7d6 (diff)
opkg: improve error reporting
git-svn-id: http://opkg.googlecode.com/svn/trunk@119 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--libopkg/opkg.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/libopkg/opkg.c b/libopkg/opkg.c
index 00d595e..223cfaf 100644
--- a/libopkg/opkg.c
+++ b/libopkg/opkg.c
@@ -455,6 +455,13 @@ opkg_install_package (opkg_t *opkg, const char *package_name, opkg_progress_call
(curl_progress_func) curl_progress_cb, &cb_data);
free(url);
+ if (err)
+ {
+ pkg_vec_free (deps);
+ opkg_package_free (pdata.package);
+ return OPKG_DOWNLOAD_FAILED;
+ }
+
}
pkg_vec_free (deps);
@@ -478,14 +485,20 @@ opkg_install_package (opkg_t *opkg, const char *package_name, opkg_progress_call
err = opkg_install_pkg(opkg->conf, new, 0);
if (err)
- return err;
+ {
+ opkg_package_free (pdata.package);
+ return OPKG_UNKNOWN_ERROR;
+ }
progress (pdata, 75);
/* run configure scripts, etc. */
err = opkg_configure_packages (opkg->conf, NULL);
if (err)
- return err;
+ {
+ opkg_package_free (pdata.package);
+ return OPKG_UNKOWN_ERROR;
+ }
/* write out status files and file lists */
opkg_conf_write_status_files (opkg->conf);
@@ -597,10 +610,14 @@ opkg_upgrade_package (opkg_t *opkg, const char *package_name, opkg_progress_call
pdata.package = old_pkg_to_new (pkg);
progress (pdata, 0);
- opkg_upgrade_pkg (opkg->conf, pkg);
+ err = opkg_upgrade_pkg (opkg->conf, pkg);
+ if (err)
+ return OPKG_UNKNOWN_ERROR;
progress (pdata, 75);
- opkg_configure_packages (opkg->conf, NULL);
+ err = opkg_configure_packages (opkg->conf, NULL);
+ if (err)
+ OPKG_UNKNOWN_ERROR;
progress (pdata, 100);
opkg_package_free (pdata.package);
return 0;