diff options
author | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:20:01 (EST) |
---|---|---|
committer | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:20:01 (EST) |
commit | a88680662fe0a5ea96aaa64b3a41e8200ee4b15c (patch) | |
tree | 2d0ca3dad7547fc62c6f873342dcacdbf328f341 | |
parent | c0fae254580423e0c7e5a6f140645e0db8fdfb37 (diff) |
opkg: report errors from opkg_remove_pkg
git-svn-id: http://opkg.googlecode.com/svn/trunk@121 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r-- | libopkg/opkg.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libopkg/opkg.c b/libopkg/opkg.c index a6bb23c..ec524f9 100644 --- a/libopkg/opkg.c +++ b/libopkg/opkg.c @@ -512,6 +512,7 @@ opkg_install_package (opkg_t *opkg, const char *package_name, opkg_progress_call int opkg_remove_package (opkg_t *opkg, const char *package_name, opkg_progress_callback_t progress_callback, void *user_data) { + int err; pkg_t *pkg = NULL; pkg_t *pkg_to_remove; opkg_progress_data_t pdata; @@ -519,11 +520,8 @@ opkg_remove_package (opkg_t *opkg, const char *package_name, opkg_progress_callb opkg_assert (opkg != NULL); opkg_assert (package_name != NULL); - - pkg_info_preinstall_check (opkg->conf); - pkg = pkg_hash_fetch_installed_by_name (&opkg->conf->pkg_hash, package_name); if (pkg == NULL) @@ -558,7 +556,7 @@ opkg_remove_package (opkg_t *opkg, const char *package_name, opkg_progress_callb progress (pdata, 75); - opkg_remove_pkg (opkg->conf, pkg_to_remove, 0); + err = opkg_remove_pkg (opkg->conf, pkg_to_remove, 0); /* write out status files and file lists */ opkg_conf_write_status_files (opkg->conf); @@ -567,7 +565,7 @@ opkg_remove_package (opkg_t *opkg, const char *package_name, opkg_progress_callb progress (pdata, 100); opkg_package_free (pdata.package); - return 0; + return (err) ? OPKG_UNKNOWN_ERROR : OPKG_NO_ERROR; } int |