r4449 - trunk/src/target/opkg/libopkg
thomas at docs.openmoko.org
thomas at docs.openmoko.org
Tue May 27 12:18:54 CEST 2008
Author: thomas
Date: 2008-05-27 12:18:53 +0200 (Tue, 27 May 2008)
New Revision: 4449
Modified:
trunk/src/target/opkg/libopkg/opkg.c
Log:
opkg: improve error reporting
Modified: trunk/src/target/opkg/libopkg/opkg.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg.c 2008-05-22 09:24:48 UTC (rev 4448)
+++ trunk/src/target/opkg/libopkg/opkg.c 2008-05-27 10:18:53 UTC (rev 4449)
@@ -455,6 +455,13 @@
(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 @@
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 @@
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;
More information about the commitlog
mailing list