opkg_manager: rename some command vars for better readability

Origin commit data
------------------
Branch: ni/coolstream
Commit: 3e788f9747
Author: Thilo Graf <dbt@novatux.de>
Date: 2021-04-10 (Sat, 10 Apr 2021)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
2021-04-10 22:19:43 +02:00
committed by vanhofen
parent 2aa38995c4
commit 420366b890
2 changed files with 89 additions and 89 deletions

View File

@@ -62,17 +62,17 @@
#include <fstream> #include <fstream>
#if 1 #if 1
#define OPKG_CL "opkg" #define OPKG "opkg"
#else #else
#define OPKG_CL "opkg-cl" #define OPKG "opkg-cl"
#endif #endif
#define OPKG_TMP_DIR "/tmp/.opkg" #define OPKG_TMP_DIR "/tmp/.opkg"
#define OPKG_TEST_DIR OPKG_TMP_DIR "/test" #define OPKG_TEST_DIR OPKG_TMP_DIR "/test"
#if 0 #if 0
#define OPKG_CL_CONFIG_OPTIONS " -V2 --tmp-dir=/tmp --cache=" OPKG_TMP_DIR #define OPKG_CONFIG_OPTIONS " -V2 --tmp-dir=/tmp --cache=" OPKG_TMP_DIR
#else #else
#define OPKG_CL_CONFIG_OPTIONS "" #define OPKG_CONFIG_OPTIONS ""
#endif #endif
#define OPKG_BAD_PATTERN_LIST_FILE CONFIGDIR "/bad_package_pattern.list" #define OPKG_BAD_PATTERN_LIST_FILE CONFIGDIR "/bad_package_pattern.list"
@@ -93,35 +93,35 @@ using namespace std;
enum enum
{ {
OM_LIST, CMD_LIST,
OM_LIST_INSTALLED, CMD_LIST_INSTALLED,
OM_LIST_UPGRADEABLE, CMD_LIST_UPGRADEABLE,
OM_UPDATE, CMD_UPDATE,
OM_UPGRADE, CMD_UPGRADE,
OM_REMOVE, CMD_REMOVE,
OM_INFO, CMD_INFO,
OM_INSTALL, CMD_INSTALL,
OM_STATUS, CMD_STATUS,
OM_CONFIGURE, CMD_CONFIGURE,
OM_DOWNLOAD, CMD_DOWNLOAD,
OM_CLEAN, CMD_CLEAN,
OM_MAX CMD_MAX
}; };
static string pkg_types[OM_MAX] = static string pm_cmd[CMD_MAX] =
{ {
OPKG_CL " list ", OPKG " list ",
OPKG_CL " list-installed ", OPKG " list-installed ",
OPKG_CL " list-upgradable ", OPKG " list-upgradable ",
OPKG_CL " -A update ", OPKG " -A update ",
OPKG_CL OPKG_CL_CONFIG_OPTIONS " upgrade ", OPKG OPKG_CONFIG_OPTIONS " upgrade ",
OPKG_CL OPKG_CL_CONFIG_OPTIONS " remove ", OPKG OPKG_CONFIG_OPTIONS " remove ",
OPKG_CL " info ", OPKG " info ",
OPKG_CL OPKG_CL_CONFIG_OPTIONS " install ", OPKG OPKG_CONFIG_OPTIONS " install ",
OPKG_CL " status ", OPKG " status ",
OPKG_CL " configure ", OPKG " configure ",
OPKG_CL " download ", OPKG " download ",
OPKG_CL " clean " OPKG " clean "
}; };
COPKGManager::COPKGManager(int wizard_mode): opkg_conf('\t') COPKGManager::COPKGManager(int wizard_mode): opkg_conf('\t')
@@ -135,7 +135,7 @@ void COPKGManager::init(int wizard_mode)
return; return;
is_wizard = wizard_mode; is_wizard = wizard_mode;
OM_ERRORS(); OPKG_ERRORS();
width = 80; width = 80;
//define default dest keys //define default dest keys
@@ -158,7 +158,7 @@ void COPKGManager::init(int wizard_mode)
COPKGManager::~COPKGManager() COPKGManager::~COPKGManager()
{ {
pkg_map.clear(); pkg_map.clear();
execCmd(pkg_types[OM_CLEAN], CShellWindow::QUIET); execCmd(pm_cmd[CMD_CLEAN], CShellWindow::QUIET);
CFileHelpers::removeDir(OPKG_TMP_DIR); CFileHelpers::removeDir(OPKG_TMP_DIR);
} }
@@ -188,7 +188,7 @@ int COPKGManager::exec(CMenuTarget* parent, const string &actionKey)
if (ShowMsg(LOCALE_OPKG_TITLE, loc, CMsgBox::mbrCancel, CMsgBox::mbYes | CMsgBox::mbCancel) != CMsgBox::mbrCancel) { if (ShowMsg(LOCALE_OPKG_TITLE, loc, CMsgBox::mbrCancel, CMsgBox::mbYes | CMsgBox::mbCancel) != CMsgBox::mbrCancel) {
if (parent) if (parent)
parent->hide(); parent->hide();
execCmd(pkg_types[OM_REMOVE] + pkg_vec[selected]->name, CShellWindow::VERBOSE | CShellWindow::ACKNOWLEDGE_EVENT); execCmd(pm_cmd[CMD_REMOVE] + pkg_vec[selected]->name, CShellWindow::VERBOSE | CShellWindow::ACKNOWLEDGE_EVENT);
refreshMenu(); refreshMenu();
} }
return res; return res;
@@ -245,7 +245,7 @@ int COPKGManager::exec(CMenuTarget* parent, const string &actionKey)
} }
return res; return res;
} }
if(actionKey == pkg_types[OM_UPGRADE]) { if(actionKey == pm_cmd[CMD_UPGRADE]) {
if (parent) if (parent)
parent->hide(); parent->hide();
int r = execCmd(actionKey, CShellWindow::VERBOSE | CShellWindow::ACKNOWLEDGE_EVENT); int r = execCmd(actionKey, CShellWindow::VERBOSE | CShellWindow::ACKNOWLEDGE_EVENT);
@@ -331,7 +331,7 @@ bool COPKGManager::checkSize(const string& pkg_name)
if(!access( pkg_file.c_str(), F_OK)) //use local package if(!access( pkg_file.c_str(), F_OK)) //use local package
fh.copyFile(pkg_file.c_str(), tmp_dest_file.c_str(), 0644); fh.copyFile(pkg_file.c_str(), tmp_dest_file.c_str(), 0644);
else else
execCmd(pkg_types[OM_DOWNLOAD] + plain_pkg); //download package execCmd(pm_cmd[CMD_DOWNLOAD] + plain_pkg); //download package
//unpack package into test dir //unpack package into test dir
string ar = "ar -x " + plain_pkg + char(0x2a); string ar = "ar -x " + plain_pkg + char(0x2a);
@@ -435,8 +435,8 @@ bool COPKGManager::badpackage(std::string &s)
void COPKGManager::updateMenu() void COPKGManager::updateMenu()
{ {
bool upgradesAvailable = false; bool upgradesAvailable = false;
getPkgData(OM_LIST_INSTALLED); getPkgData(CMD_LIST_INSTALLED);
getPkgData(OM_LIST_UPGRADEABLE); getPkgData(CMD_LIST_UPGRADEABLE);
for (map<string, struct pkg>::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) { for (map<string, struct pkg>::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) {
/* this should no longer trigger at all */ /* this should no longer trigger at all */
if (badpackage(it->second.name)) if (badpackage(it->second.name))
@@ -533,10 +533,10 @@ bool COPKGManager::checkUpdates(const std::string & package_name, bool show_prog
status->showStatus(25); /* after do_update, we have actually done the hardest work already */ status->showStatus(25); /* after do_update, we have actually done the hardest work already */
} }
getPkgData(OM_LIST); getPkgData(CMD_LIST);
if (show_progress) if (show_progress)
status->showStatus(50); status->showStatus(50);
getPkgData(OM_LIST_UPGRADEABLE); getPkgData(CMD_LIST_UPGRADEABLE);
if (show_progress) if (show_progress)
status->showStatus(75); status->showStatus(75);
@@ -584,7 +584,7 @@ int COPKGManager::doUpdate()
hintBox->paint(); hintBox->paint();
} }
int r = execCmd(pkg_types[OM_UPDATE], CShellWindow::QUIET); int r = execCmd(pm_cmd[CMD_UPDATE], CShellWindow::QUIET);
if (hintBox){ if (hintBox){
hintBox->hide(); hintBox->hide();
@@ -613,8 +613,8 @@ int COPKGManager::showMenu()
installed = false; installed = false;
setUpdateCheckResult(true); setUpdateCheckResult(true);
#if 0 #if 0
getPkgData(OM_LIST); getPkgData(CMD_LIST);
getPkgData(OM_LIST_UPGRADEABLE); getPkgData(CMD_LIST_UPGRADEABLE);
#endif #endif
menu = new CMenuWidget(g_Locale->getText(LOCALE_SERVICEMENU_UPDATE), NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_SOFTWAREUPDATE); menu = new CMenuWidget(g_Locale->getText(LOCALE_SERVICEMENU_UPDATE), NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_SOFTWAREUPDATE);
@@ -623,7 +623,7 @@ int COPKGManager::showMenu()
//upgrade all installed packages //upgrade all installed packages
std::string upd_info = to_string(num_updates) + " " + g_Locale->getText(LOCALE_OPKG_MESSAGEBOX_UPDATES_AVAILABLE); std::string upd_info = to_string(num_updates) + " " + g_Locale->getText(LOCALE_OPKG_MESSAGEBOX_UPDATES_AVAILABLE);
upgrade_forwarder = new CMenuForwarder(LOCALE_OPKG_UPGRADE, true, upd_info.c_str() , this, pkg_types[OM_UPGRADE].c_str(), CRCInput::RC_red); upgrade_forwarder = new CMenuForwarder(LOCALE_OPKG_UPGRADE, true, upd_info.c_str() , this, pm_cmd[CMD_UPGRADE].c_str(), CRCInput::RC_red);
upgrade_forwarder->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_OPKG_UPGRADE); upgrade_forwarder->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_OPKG_UPGRADE);
menu->addItem(upgrade_forwarder); menu->addItem(upgrade_forwarder);
@@ -715,14 +715,14 @@ int COPKGManager::showMenu()
bool COPKGManager::hasOpkgSupport() bool COPKGManager::hasOpkgSupport()
{ {
if (find_executable(OPKG_CL).empty()) { if (find_executable(OPKG).empty()) {
dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d]" OPKG_CL " executable not found\n", __func__, __LINE__); dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d]" OPKG " executable not found\n", __func__, __LINE__);
return false; return false;
} }
if (! find_executable(SYSTEM_UPDATE).empty()) { if (! find_executable(SYSTEM_UPDATE).empty()) {
dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d] " SYSTEM_UPDATE " script found\n", __func__, __LINE__); dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d] " SYSTEM_UPDATE " script found\n", __func__, __LINE__);
pkg_types[OM_UPGRADE] = SYSTEM_UPDATE; pm_cmd[CMD_UPGRADE] = SYSTEM_UPDATE;
} }
#if 0 #if 0
@@ -782,7 +782,7 @@ string COPKGManager::getPkgDescription(std::string pkgName, std::string pkgDesc)
string line(buf); string line(buf);
trim(line, " "); trim(line, " ");
string tmp; string tmp;
/* When pkgDesc is empty, return description only for OM_INFO */ /* When pkgDesc is empty, return description only for CMD_INFO */
if (!pkgDesc.empty()) { if (!pkgDesc.empty()) {
tmp = getKeyInfo(line, "Package:", " "); tmp = getKeyInfo(line, "Package:", " ");
if (!tmp.empty()) if (!tmp.empty())
@@ -811,22 +811,22 @@ string COPKGManager::getPkgDescription(std::string pkgName, std::string pkgDesc)
void COPKGManager::getPkgData(const int pkg_content_id) void COPKGManager::getPkgData(const int pkg_content_id)
{ {
dprintf(DEBUG_INFO, "[COPKGManager] [%s - %d] executing %s\n", __func__, __LINE__, pkg_types[pkg_content_id].c_str()); dprintf(DEBUG_INFO, "[COPKGManager] [%s - %d] executing %s\n", __func__, __LINE__, pm_cmd[pkg_content_id].c_str());
switch (pkg_content_id) { switch (pkg_content_id) {
case OM_LIST: case CMD_LIST:
pkg_map.clear(); pkg_map.clear();
list_installed_done = false; list_installed_done = false;
list_upgradeable_done = false; list_upgradeable_done = false;
break; break;
case OM_LIST_INSTALLED: case CMD_LIST_INSTALLED:
if (list_installed_done) if (list_installed_done)
return; return;
list_installed_done = true; list_installed_done = true;
for (map<string, struct pkg>::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) for (map<string, struct pkg>::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it)
it->second.installed = false; it->second.installed = false;
break; break;
case OM_LIST_UPGRADEABLE: case CMD_LIST_UPGRADEABLE:
if (list_upgradeable_done) if (list_upgradeable_done)
return; return;
list_upgradeable_done = true; list_upgradeable_done = true;
@@ -836,9 +836,9 @@ void COPKGManager::getPkgData(const int pkg_content_id)
} }
pid_t pid = 0; pid_t pid = 0;
FILE *f = my_popen(pid, pkg_types[pkg_content_id].c_str(), "r"); FILE *f = my_popen(pid, pm_cmd[pkg_content_id].c_str(), "r");
if (!f) { if (!f) {
showError("Internal Error", strerror(errno), pkg_types[pkg_content_id]); showError("Internal Error", strerror(errno), pm_cmd[pkg_content_id]);
return; return;
} }
@@ -856,7 +856,7 @@ void COPKGManager::getPkgData(const int pkg_content_id)
continue; continue;
switch (pkg_content_id) { switch (pkg_content_id) {
case OM_LIST: { case CMD_LIST: {
/* do not even put "bad" packages into the list to save memory */ /* do not even put "bad" packages into the list to save memory */
if (badpackage(name)) if (badpackage(name))
continue; continue;
@@ -866,13 +866,13 @@ void COPKGManager::getPkgData(const int pkg_content_id)
it->second.desc = getPkgDescription(name, line); it->second.desc = getPkgDescription(name, line);
break; break;
} }
case OM_LIST_INSTALLED: { case CMD_LIST_INSTALLED: {
map<string, struct pkg>::iterator it = pkg_map.find(name); map<string, struct pkg>::iterator it = pkg_map.find(name);
if (it != pkg_map.end()) if (it != pkg_map.end())
it->second.installed = true; it->second.installed = true;
break; break;
} }
case OM_LIST_UPGRADEABLE: { case CMD_LIST_UPGRADEABLE: {
map<string, struct pkg>::iterator it = pkg_map.find(name); map<string, struct pkg>::iterator it = pkg_map.find(name);
if (it != pkg_map.end()) if (it != pkg_map.end())
it->second.upgradable = true; it->second.upgradable = true;
@@ -909,7 +909,7 @@ string COPKGManager::getBlankPkgName(const string& line)
string COPKGManager::getPkgInfo(const string& pkg_name, const string& pkg_key, bool current_status) string COPKGManager::getPkgInfo(const string& pkg_name, const string& pkg_key, bool current_status)
{ {
execCmd(pkg_types[current_status ? OM_STATUS : OM_INFO] + pkg_name, CShellWindow::QUIET); execCmd(pm_cmd[current_status ? CMD_STATUS : CMD_INFO] + pkg_name, CShellWindow::QUIET);
dprintf(DEBUG_INFO, "[COPKGManager] [%s - %d] [data: %s]\n", __func__, __LINE__, tmp_str.c_str()); dprintf(DEBUG_INFO, "[COPKGManager] [%s - %d] [data: %s]\n", __func__, __LINE__, tmp_str.c_str());
if (pkg_key.empty()) { if (pkg_key.empty()) {
@@ -998,14 +998,14 @@ void COPKGManager::handleShellOutput(string* cur_line, int* res, bool* ok)
dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d] result: %s\n", __func__, __LINE__, line.c_str()); dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d] result: %s\n", __func__, __LINE__, line.c_str());
*/ */
/*duplicate option cache: option is defined in OPKG_CL_CONFIG_OPTIONS, /*duplicate option cache: option is defined in OPKG_CONFIG_OPTIONS,
* NOTE: if found first cache option in the opkg.conf file, this will be preferred and it's not really an error! * NOTE: if found first cache option in the opkg.conf file, this will be preferred and it's not really an error!
*/ */
if (line.find("Duplicate option cache") != string::npos){ if (line.find("Duplicate option cache") != string::npos){
dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d] WARNING: %s\n", __func__, __LINE__, line.c_str()); dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d] WARNING: %s\n", __func__, __LINE__, line.c_str());
*ok = true; *ok = true;
has_err = false; has_err = false;
*res = OM_SUCCESS; *res = OPKG_SUCCESS;
return; return;
} }
/*resolve_conffiles: already existent configfiles are not installed, but renamed in the same directory, /*resolve_conffiles: already existent configfiles are not installed, but renamed in the same directory,
@@ -1015,30 +1015,30 @@ void COPKGManager::handleShellOutput(string* cur_line, int* res, bool* ok)
dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d] WARNING: %s\n", __func__, __LINE__, line.c_str()); dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d] WARNING: %s\n", __func__, __LINE__, line.c_str());
*ok = true; *ok = true;
has_err = false; has_err = false;
*res = OM_SUCCESS; *res = OPKG_SUCCESS;
return; return;
} }
//download error: //download error:
if (line.find("opkg_download:") != string::npos){ if (line.find("opkg_download:") != string::npos){
*res = OM_DOWNLOAD_ERR; *res = OPKG_DOWNLOAD_ERR;
//*ok = false; //*ok = false;
return; return;
} }
//not enough space //not enough space
if (line.find("No space left on device") != string::npos){ if (line.find("No space left on device") != string::npos){
*res = OM_OUT_OF_SPACE_ERR; *res = OPKG_OUT_OF_SPACE_ERR;
//*ok = false; //*ok = false;
return; return;
} }
//deps //deps
if (line.find("satisfy_dependencies") != string::npos){ if (line.find("satisfy_dependencies") != string::npos){
*res = OM_UNSATISFIED_DEPS_ERR; *res = OPKG_UNSATISFIED_DEPS_ERR;
*ok = false; *ok = false;
return; return;
} }
/* hack */ /* hack */
if (line.find("system-update: err_reset") != string::npos) { if (line.find("system-update: err_reset") != string::npos) {
*res = OM_SUCCESS; *res = OPKG_SUCCESS;
*ok = true; *ok = true;
has_err = false; has_err = false;
return; return;
@@ -1046,7 +1046,7 @@ void COPKGManager::handleShellOutput(string* cur_line, int* res, bool* ok)
//unknown error //unknown error
if (*ok){ if (*ok){
dprintf(DEBUG_DEBUG, "[COPKGManager] [%s - %d] ERROR: unhandled error %s\n", __func__, __LINE__, line.c_str()); dprintf(DEBUG_DEBUG, "[COPKGManager] [%s - %d] ERROR: unhandled error %s\n", __func__, __LINE__, line.c_str());
*res = OM_UNKNOWN_ERR; *res = OPKG_UNKNOWN_ERR;
//*ok = false; //*ok = false;
return; return;
} }
@@ -1055,7 +1055,7 @@ void COPKGManager::handleShellOutput(string* cur_line, int* res, bool* ok)
/* never reached */ /* never reached */
if (!has_err){ if (!has_err){
*ok = true; *ok = true;
*res = OM_SUCCESS; *res = OPKG_SUCCESS;
} }
#endif #endif
} }
@@ -1092,30 +1092,30 @@ bool COPKGManager::installPackage(const string& pkg_name, string options, bool f
else{ else{
string opts = " " + options + " "; string opts = " " + options + " ";
int r = execCmd(pkg_types[OM_INSTALL] + opts + pkg_name, CShellWindow::VERBOSE | CShellWindow::ACKNOWLEDGE_EVENT | CShellWindow::ACKNOWLEDGE); int r = execCmd(pm_cmd[CMD_INSTALL] + opts + pkg_name, CShellWindow::VERBOSE | CShellWindow::ACKNOWLEDGE_EVENT | CShellWindow::ACKNOWLEDGE);
if (r){ if (r){
switch(r){ switch(r){
case OM_OUT_OF_SPACE_ERR: case OPKG_OUT_OF_SPACE_ERR:
DisplayErrorMessage("Not enough space available"); DisplayErrorMessage("Not enough space available");
break; break;
case OM_DOWNLOAD_ERR: case OPKG_DOWNLOAD_ERR:
DisplayErrorMessage("Can't download package. Check network!"); DisplayErrorMessage("Can't download package. Check network!");
break; break;
case OM_UNSATISFIED_DEPS_ERR:{ case OPKG_UNSATISFIED_DEPS_ERR:{
int msgRet = ShowMsg("Installation", "Unsatisfied deps while installation! Try to repeat to force dependencies!", CMsgBox::mbrCancel, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 600, -1); int msgRet = ShowMsg("Installation", "Unsatisfied deps while installation! Try to repeat to force dependencies!", CMsgBox::mbrCancel, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 600, -1);
if (msgRet == CMsgBox::mbrYes) if (msgRet == CMsgBox::mbrYes)
return installPackage(pkg_name, "--force-depends"); return installPackage(pkg_name, "--force-depends");
break; break;
} }
default: default:
showError(g_Locale->getText(LOCALE_OPKG_FAILURE_INSTALL), NULL, pkg_types[OM_INSTALL] + opts + pkg_name); showError(g_Locale->getText(LOCALE_OPKG_FAILURE_INSTALL), NULL, pm_cmd[CMD_INSTALL] + opts + pkg_name);
/* errno / strerror considered useless here /* errno / strerror considered useless here
showError(g_Locale->getText(LOCALE_OPKG_FAILURE_INSTALL), strerror(errno), pkg_types[OM_INSTALL] + opts + pkg_name); showError(g_Locale->getText(LOCALE_OPKG_FAILURE_INSTALL), strerror(errno), pm_cmd[CMD_INSTALL] + opts + pkg_name);
*/ */
} }
}else{ }else{
if (force_configure) if (force_configure)
execCmd(pkg_types[OM_CONFIGURE] + getBlankPkgName(pkg_name), 0); execCmd(pm_cmd[CMD_CONFIGURE] + getBlankPkgName(pkg_name), 0);
installed = true; //TODO: catch real result installed = true; //TODO: catch real result
} }
} }

View File

@@ -72,30 +72,30 @@ class COPKGManager : public CMenuTarget
std::string *local_dir; std::string *local_dir;
bool has_err; bool has_err;
typedef struct om_error_data_t typedef struct OPKG_error_data_t
{ {
std::string id; std::string id;
int num; int num;
}om_error_struct_t; }OPKG_error_struct_t;
//error types //error types
enum enum
{ {
OM_UNKNOWN_ERR =-1, OPKG_UNKNOWN_ERR =-1,
OM_SUCCESS = 0, OPKG_SUCCESS = 0,
OM_UNSATISFIED_DEPS_ERR = 5, OPKG_UNSATISFIED_DEPS_ERR = 5,
OM_DOWNLOAD_ERR = 11, OPKG_DOWNLOAD_ERR = 11,
OM_CONFLICT_ERR = 12, OPKG_CONFLICT_ERR = 12,
OM_OUT_OF_SPACE_ERR = 15, OPKG_OUT_OF_SPACE_ERR = 15,
OM_PREREM_SCRIPT_ERR = 16, OPKG_PREREM_SCRIPT_ERR = 16,
}; };
om_error_data_t *err_list; OPKG_error_data_t *err_list;
void OM_ERRORS() void OPKG_ERRORS()
{ {
static om_error_data_t errlist[] = { { "Cannot satisfy the following dependencies" , OM_UNSATISFIED_DEPS_ERR }, static OPKG_error_data_t errlist[] = { { "Cannot satisfy the following dependencies" , OPKG_UNSATISFIED_DEPS_ERR },
{ "No space left on device" , OM_OUT_OF_SPACE_ERR }, { "No space left on device" , OPKG_OUT_OF_SPACE_ERR },
{ "The following packages conflict" , OM_CONFLICT_ERR }, { "The following packages conflict" , OPKG_CONFLICT_ERR },
{ "Only have" , OM_OUT_OF_SPACE_ERR }, { "Only have" , OPKG_OUT_OF_SPACE_ERR },
{ "prerm script for package" , OM_PREREM_SCRIPT_ERR }, { "prerm script for package" , OPKG_PREREM_SCRIPT_ERR },
} ; } ;
err_list = errlist; err_list = errlist;
}; };