r4459 - in trunk/src/target/opkg: . libopkg
thomas at docs.openmoko.org
thomas at docs.openmoko.org
Thu May 29 16:00:15 CEST 2008
Author: thomas
Date: 2008-05-29 16:00:11 +0200 (Thu, 29 May 2008)
New Revision: 4459
Modified:
trunk/src/target/opkg/configure.ac
trunk/src/target/opkg/libopkg/opkg.c
Log:
opkg: update error handling for opkg_update_pkg in opkg.c and bump version number
Modified: trunk/src/target/opkg/configure.ac
===================================================================
--- trunk/src/target/opkg/configure.ac 2008-05-29 11:42:33 UTC (rev 4458)
+++ trunk/src/target/opkg/configure.ac 2008-05-29 14:00:11 UTC (rev 4459)
@@ -1,6 +1,6 @@
# Process this file with autoconf to produce a configure script
AC_INIT(libopkg/libopkg.c)
-AM_INIT_AUTOMAKE([opkg], [0.1.4])
+AM_INIT_AUTOMAKE([opkg], [0.1.5])
AM_CONFIG_HEADER(libopkg/config.h)
AC_CANONICAL_HOST
Modified: trunk/src/target/opkg/libopkg/opkg.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg.c 2008-05-29 11:42:33 UTC (rev 4458)
+++ trunk/src/target/opkg/libopkg/opkg.c 2008-05-29 14:00:11 UTC (rev 4459)
@@ -620,8 +620,21 @@
progress (pdata, 0);
err = opkg_upgrade_pkg (opkg->conf, pkg);
+ /* opkg_upgrade_pkg returns the error codes of opkg_install_pkg */
if (err)
- return OPKG_UNKNOWN_ERROR;
+ {
+ switch (err)
+ {
+ case PKG_INSTALL_ERR_NOT_TRUSTED: return OPKG_GPG_ERROR;
+ case PKG_INSTALL_ERR_DOWNLOAD: return OPKG_DOWNLOAD_FAILED;
+ case PKG_INSTALL_ERR_DEPENDENCIES:
+ case PKG_INSTALL_ERR_CONFLICTS: return OPKG_DEPENDENCIES_FAILED;
+ case PKG_INSTALL_ERR_ALREADY_INSTALLED: return OPKG_PACKAGE_ALREADY_INSTALLED;
+ case PKG_INSTALL_ERR_SIGNATURE: return OPKG_GPG_ERROR;
+ case PKG_INSTALL_ERR_MD5: return OPKG_MD5_ERROR;
+ default: return OPKG_UNKNOWN_ERROR;
+ }
+ }
progress (pdata, 75);
err = opkg_configure_packages (opkg->conf, NULL);
More information about the commitlog
mailing list