From 042e66dd379027f7c5118a7c0f0bc139b23be20b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 30 Dec 2014 21:18:44 +0100 Subject: [PATCH] COPKGManager: show message on space error Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/28d17802d400f3e4b8c95b6e4db629f677e486d6 Author: Thilo Graf Date: 2014-12-30 (Tue, 30 Dec 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/opkg_manager.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index af3785697..9483712f3 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -368,7 +368,8 @@ int COPKGManager::doUpdate() { int r = execCmd(pkg_types[OM_UPDATE]); if (r == -1) { - DisplayErrorMessage(g_Locale->getText(LOCALE_OPKG_FAILURE_UPDATE)); + string msg = string(g_Locale->getText(LOCALE_OPKG_FAILURE_UPDATE)) + "\n" + err_msg; + DisplayErrorMessage(msg.c_str()); return r; } return 0; @@ -669,6 +670,10 @@ void COPKGManager::handleShellOutput(string& cur_line) err_msg += "Cannot install package!\n"; has_err = true; } + if (cur_line.find("No space left on device") != string::npos){ + err_msg += "Not enough space available!\n"; + has_err = true; + } if (has_err) return; @@ -677,9 +682,10 @@ void COPKGManager::handleShellOutput(string& cur_line) if (pos1 != string::npos){ string str = cur_line.substr(pos1, cur_line.length()-pos1); err_msg += str.replace(pos1, 3,"") + "\n"; - return; + has_err = true; } - + if (has_err) + return; } if (!has_err) tmp_str += cur_line + "\n";