From 8c9c7528c65a2e5c9ba7e92521e00fa04052131e Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Mon, 15 Dec 2008 00:21:36 -0500 Subject: opkg: consolidate error enums and add an error for when no package matches current architecture git-svn-id: http://opkg.googlecode.com/svn/trunk@128 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'libopkg/opkg_cmd.c') diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c index d883c7b..94cfb99 100644 --- a/libopkg/opkg_cmd.c +++ b/libopkg/opkg_cmd.c @@ -116,7 +116,7 @@ static void write_status_files_if_changed(opkg_conf_t *conf) opkg_conf_write_status_files(conf); pkg_write_changed_filelists(conf); } else { - opkg_message(conf, OPKG_NOTICE, "Nothing to be done\n"); + opkg_message(conf, OPKG_DEBUG, "Nothing to be done\n"); } } @@ -146,7 +146,7 @@ int opkg_cmd_exec(opkg_cmd_t *cmd, opkg_conf_t *conf, int argc, const char **arg result = (cmd->fun)(conf, argc, argv); - if ( result != 0 ) { + if ( result != 0 && !error_list) { opkg_message(conf, OPKG_NOTICE, "An error ocurred, return value: %d.\n", result); } @@ -156,7 +156,7 @@ int opkg_cmd_exec(opkg_cmd_t *cmd, opkg_conf_t *conf, int argc, const char **arg opkg_message(conf, OPKG_NOTICE, "Collected errors:\n"); /* Here we print the errors collected and free the list */ while (error_list != NULL) { - opkg_message(conf, OPKG_NOTICE, "%s",error_list->errmsg); + opkg_message(conf, OPKG_NOTICE, " * %s", error_list->errmsg); error_list = error_list->next; } @@ -593,8 +593,7 @@ static int opkg_install_cmd(opkg_conf_t *conf, int argc, char **argv) err = opkg_install_by_name(conf, arg); if (err == OPKG_PKG_HAS_NO_CANDIDATE) { opkg_message(conf, OPKG_ERROR, - "Cannot find package %s.\n" - "Check the spelling or perhaps run 'opkg update'\n", + "Cannot find package %s.\n", arg); } } @@ -683,7 +682,7 @@ static int opkg_download_cmd(opkg_conf_t *conf, int argc, char **argv) for (i = 0; i < argc; i++) { arg = argv[i]; - pkg = pkg_hash_fetch_best_installation_candidate_by_name(conf, arg); + pkg = pkg_hash_fetch_best_installation_candidate_by_name(conf, arg, &err); if (pkg == NULL) { opkg_message(conf, OPKG_ERROR, "Cannot find package %s.\n" -- cgit v0.9.1