#include <widget_parser.h>
#include <root_parser.h>
-
-
#define NOFILE_CNT_FOR_INSTALLER 9999
using namespace WrtDB;
const double BASE_LAYOUT_H = 1280.0f;
const char * const CONFIG_XML = "config.xml";
+const char * const HYBRID_CONFIG_XML = "res/wgt/config.xml";
struct free_deleter
{
- void operator()(void* x) { free(x); }
+ void operator()(void* x)
+ {
+ free(x);
+ }
};
struct PluginInstallerData
WrtInstaller::WrtInstaller(int argc, char **argv) :
Application(argc, argv, "backend", false),
DPL::TaskDecl<WrtInstaller>(this),
+ m_installPolicy(WRT_WIM_NOT_INSTALLED),
m_packagePath(),
m_handle(-1),
m_initialized(false),
void WrtInstaller::OnCreate()
{
LogInfo("Creating DummyClient");
+ fprintf(stderr,
+ "===========================================================\n");
+ fprintf(stderr, "# wrt-installer #\n");
+ fprintf(stderr, "# argc [%d]\n", m_argc);
+ fprintf(stderr, "# argv[0] = [%s]\n", m_argv[0]);
+ fprintf(stderr, "# argv[1] = [%s]\n", m_argv[1]);
+ fprintf(stderr, "# argv[2] = [%s]\n", m_argv[2]);
+ fprintf(stderr,
+ "===========================================================\n");
AddStep(&WrtInstaller::initStep);
std::string arg = m_argv[0];
- pkgmgrSignalInterface = std::static_pointer_cast<PackageManager::IPkgmgrSignal>(
- std::shared_ptr<PackageManager::PkgmgrSignalDummy>(
- new PackageManager::PkgmgrSignalDummy()
- )
- );
+ pkgmgrSignalInterface =
+ std::static_pointer_cast<PackageManager::IPkgmgrSignal>(
+ std::shared_ptr<PackageManager::PkgmgrSignalDummy>(
+ new PackageManager::PkgmgrSignalDummy()
+ )
+ );
if (arg.empty()) {
return showHelpAndQuit();
installNewPlugins();
- if (arg.find("wrt-installer") != std::string::npos)
- {
+ if (arg.find("wrt-installer") != std::string::npos) {
if (m_argc <= 1) {
return showHelpAndQuit();
}
if (-1 != stat(m_argv[2], &info) && S_ISDIR(info.st_mode)) {
LogInfo("Installing package directly from directory");
m_installPolicy = WRT_WIM_POLICY_DIRECTORY_FORCE_INSTALL;
- }
- else
- {
+ } else {
LogInfo("Installing from regular location");
m_installPolicy = WRT_WIM_POLICY_WAC;
}
}
m_name = m_argv[2];
AddStep(&WrtInstaller::uninstallPkgNameStep);
- } else if (arg == "-ug" || arg == "--uninstall-guid") {
- if (m_argc != 3) {
- return showHelpAndQuit();
- }
- m_name = m_argv[2];
- AddStep(&WrtInstaller::uninstallGuidStep);
} else if (arg == "-up" || arg == "--uninstall-packagepath") {
if (m_argc != 3) {
return showHelpAndQuit();
} else {
return showHelpAndQuit();
}
-
} else if (arg.find("backend") != std::string::npos) {
using namespace PackageManager;
m_installByPkgmgr = true;
- auto pkgmgrSignal = std::shared_ptr<PackageManager::PkgmgrSignal>(
- new PackageManager::PkgmgrSignal()
- );
+ auto pkgmgrSignal = std::shared_ptr<PackageManager::PkgmgrSignal>(
+ new PackageManager::PkgmgrSignal()
+ );
pkgmgrSignal->initialize(m_argc, m_argv);
m_quiet = pkgmgrSignal->isNoPopupRequired();
- LogDebug("backend m_quiet"<<m_quiet);
+ LogDebug("backend m_quiet" << m_quiet);
int reqType = pkgmgrSignal->getRequestedType();
pkgmgrSignalInterface =
- std::static_pointer_cast<PackageManager::IPkgmgrSignal>(pkgmgrSignal);
+ std::static_pointer_cast<PackageManager::IPkgmgrSignal>(
+ pkgmgrSignal);
switch (reqType) {
- case PKGMGR_REQ_INSTALL:
- m_packagePath = m_argv[4];
- struct stat info;
- if (-1 != stat(m_argv[4], &info) && S_ISDIR(info.st_mode)) {
- LogInfo("Installing package directly from directory");
- m_installPolicy = WRT_WIM_POLICY_DIRECTORY_FORCE_INSTALL;
- }
- else
- {
- LogInfo("Installing from regular location");
- m_installPolicy = WRT_WIM_POLICY_WAC;
- }
- AddStep(&WrtInstaller::installStep);
- break;
- case PKGMGR_REQ_UNINSTALL:
- m_name = m_argv[4];
- AddStep(&WrtInstaller::uninstallPkgNameStep);
- break;
- default:
- LogDebug("Not available type");
- break;
+ case PKGMGR_REQ_INSTALL:
+ m_packagePath = m_argv[4];
+ struct stat info;
+ if (-1 != stat(m_argv[4], &info) && S_ISDIR(info.st_mode)) {
+ LogInfo("Installing package directly from directory");
+ m_installPolicy = WRT_WIM_POLICY_DIRECTORY_FORCE_INSTALL;
+ } else {
+ LogInfo("Installing from regular location");
+ m_installPolicy = WRT_WIM_POLICY_WAC;
+ }
+ AddStep(&WrtInstaller::installStep);
+ break;
+ case PKGMGR_REQ_UNINSTALL:
+ m_name = m_argv[4];
+ AddStep(&WrtInstaller::uninstallPkgNameStep);
+ break;
+ default:
+ LogDebug("Not available type");
+ break;
}
}
AddStep(&WrtInstaller::shutdownStep);
- DPL::Event::ControllerEventHandler<WRTInstallerNS::NextStepEvent>::PostEvent(
+ DPL::Event::ControllerEventHandler<WRTInstallerNS::NextStepEvent>::
+ PostEvent(
WRTInstallerNS::NextStepEvent());
}
void WrtInstaller::showHelpAndQuit()
{
- printf("Usage: wrt-installer [OPTION]... [WIDGET: ID/NAME/GUID/PATH]...\n"
+ printf("Usage: wrt-installer [OPTION]... [WIDGET: ID/NAME/PATH]...\n"
"Operate with WebRuntime daemon: install, uninstall"
" and launch widgets.\n"
"Query list of installed widgets and setup up debugging support.\n"
"install forcibly widget package for given path\n"
" -un, --uninstall-name "
"uninstall widget for given package name\n"
- " -ug, --uninstall-guid "
- "uninstall widget for given Global Unique IDentifier\n"
" -up, --uninstall-packagepath "
"uninstall widget for given package file path\n"
"\n");
if (m_initialized) {
LogDebug("Wrt Shutdown now");
SwitchToStep(&WrtInstaller::shutdownStep);
- DPL::Event::ControllerEventHandler<WRTInstallerNS::NextStepEvent>::PostEvent(
+ DPL::Event::ControllerEventHandler<WRTInstallerNS::NextStepEvent>::
+ PostEvent(
WRTInstallerNS::NextStepEvent());
} else {
LogDebug("Quiting application");
(*m_pluginsPaths).pop_front();
wrt_install_plugin(privateData->pluginPath.c_str(),
- static_cast<void*>(privateData),
- &staticWrtPluginInstallationCallback,
- &staticWrtPluginInstallProgressCb);
+ static_cast<void*>(privateData),
+ &staticWrtPluginInstallationCallback,
+ &staticWrtPluginInstallProgressCb);
} else {
delete privateData;
}
{
LogDebug("Installing widget ...");
std::unique_ptr<char, free_deleter> packagePath(canonicalize_file_name(
- m_packagePath.c_str()));
+ m_packagePath.c_str()));
wrt_install_widget(packagePath ? packagePath.get() : m_packagePath.c_str(),
this, &staticWrtStatusCallback,
void WrtInstaller::installPluginsStep()
{
LogDebug("Installing plugins ...");
+ fprintf(stderr, "Installing plugins ...\n");
if (m_startupPluginInstallation) {
LogInfo("Plugin installation started because new plugin package found");
} else if (!PluginUtils::lockPluginInstallation()) {
LogError("Failed to open plugin installation lock file"
- " Plugins are currently installed by other process");
- staticWrtPluginInstallationCallback(WRT_PLUGIN_INSTALLER_ERROR_LOCK,
- this);
+ " Plugins are currently installed by other process");
+ staticWrtPluginInstallationCallback(WRT_INSTALLER_ERROR_PLUGIN_INSTALLATION_FAILED,
+ this);
return;
}
}
LogInfo("Plugin DIRECTORY IS" << PLUGIN_PATH);
- struct dirent* libdir;
-
- errno = 0;
std::list<std::string> pluginsPaths;
-
- while ((libdir = readdir(dir)) != 0) {
- if (strcmp(libdir->d_name, ".") == 0 ||
- strcmp(libdir->d_name, "..") == 0)
+ struct dirent libdir;
+ struct dirent *result;
+ int return_code;
+ errno = 0;
+ for (return_code = readdir_r(dir, &libdir, &result);
+ result != NULL && return_code == 0;
+ return_code = readdir_r(dir, &libdir, &result))
+ {
+ if (strcmp(libdir.d_name, ".") == 0 ||
+ strcmp(libdir.d_name, "..") == 0)
{
continue;
}
std::string path = PLUGIN_PATH;
path += "/";
- path += libdir->d_name;
+ path += libdir.d_name;
struct stat tmp;
pluginsPaths.push_back(path);
}
+ if (return_code != 0 || errno != 0) {
+ LogError("readdir_r() failed with " << DPL::GetErrnoString());
+ }
+
//set nb of plugins to install
//this value indicate how many callbacks are expected
m_numPluginsToInstall = pluginsPaths.size();
if (-1 == TEMP_FAILURE_RETRY(closedir(dir))) {
LogError("Failed to close dir: " << PLUGIN_PATH << " with error: "
- << DPL::GetErrnoString());
+ << DPL::GetErrnoString());
}
}
LogDebug("Uninstalling widget ...");
LogDebug("Package name : " << m_name);
wrt_uninstall_widget(m_name.c_str(), this, &staticWrtStatusCallback,
- (!m_quiet || m_installByPkgmgr)
- ? &staticWrtUninstallProgressCallback : NULL,
- pkgmgrSignalInterface);
-}
-
-void WrtInstaller::uninstallGuidStep()
-{
- LogDebug("Uninstalling widget ...");
- std::string pkgname;
- WrtErrStatus status = wrt_get_widget_by_guid(pkgname, m_name);
- if (status == WRT_SUCCESS) {
- LogDebug("Guid : " << m_name);
- wrt_uninstall_widget(pkgname.c_str(), this, &staticWrtStatusCallback,
- !m_quiet ? &staticWrtUninstallProgressCallback : NULL,
- pkgmgrSignalInterface);
- } else {
- printf("failed: can not uninstall widget\n");
- LogError("Fail to uninstalling widget... ");
- m_returnStatus = -1;
- DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::PostEvent(
- WRTInstallerNS::QuitEvent());
- }
+ (!m_quiet || m_installByPkgmgr)
+ ? &staticWrtUninstallProgressCallback : NULL,
+ pkgmgrSignalInterface);
}
void WrtInstaller::unistallWgtFileStep()
// Open zip file
std::unique_ptr<DPL::ZipInput> zipFile(
- new DPL::ZipInput(m_packagePath));
+ new DPL::ZipInput(m_packagePath));
+ std::unique_ptr<DPL::ZipInput::File> configFile;
- // Open config.xml file
- std::unique_ptr<DPL::ZipInput::File> configFile(
- zipFile->OpenFile(CONFIG_XML));
+ Try {
+ // Open config.xml file
+ configFile.reset(zipFile->OpenFile(CONFIG_XML));
+ }
+ Catch(DPL::ZipInput::Exception::OpenFileFailed)
+ {
+ // Open config.xml file for hybrid
+ configFile.reset(zipFile->OpenFile(HYBRID_CONFIG_XML));
+ }
// Extract config
DPL::BinaryQueue buffer;
DPL::AbstractWaitableOutputAdapter outputAdapter(&buffer);
DPL::Copy(&inputAdapter, &outputAdapter);
parser.Parse(&buffer,
- ElementParserPtr(
- new RootParser<WidgetParser>(configInfo,
- DPL::FromUTF32String(
- L"widget"))));
-
- DPL::OptionalString widgetGUID = configInfo.widget_id;
-
- std::string guid = DPL::ToUTF8String(*widgetGUID);
-
- std::string pkgname;
- WrtErrStatus status = wrt_get_widget_by_guid(pkgname, guid);
- if (status == WRT_SUCCESS) {
- LogDebug("Pkgname from packagePath : " << pkgname);
- wrt_uninstall_widget(pkgname.c_str(), this, &staticWrtStatusCallback,
- !m_quiet ? &staticWrtUninstallProgressCallback : NULL,
- pkgmgrSignalInterface);
+ ElementParserPtr(
+ new RootParser<WidgetParser>(configInfo,
+ DPL::FromUTF32String(
+ L"widget"))));
+
+ DPL::OptionalString pkgId = configInfo.tizenPkgId;
+ if (!pkgId.IsNull()) {
+ LogDebug("Pkgid from packagePath : " << pkgId);
+ wrt_uninstall_widget(
+ DPL::ToUTF8String(*pkgId).c_str(), this, &staticWrtStatusCallback,
+ !m_quiet ? &staticWrtUninstallProgressCallback
+ : NULL,
+ pkgmgrSignalInterface);
} else {
LogError("Fail to uninstalling widget... ");
m_returnStatus = -1;
- DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::PostEvent(
- WRTInstallerNS::QuitEvent());
+ DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::
+ PostEvent(
+ WRTInstallerNS::QuitEvent());
}
}
Catch(DPL::ZipInput::Exception::OpenFailed)
LogError("Failed to open widget package");
printf("failed: widget package does not exist\n");
m_returnStatus = -1;
- DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::PostEvent(
- WRTInstallerNS::QuitEvent());
+ DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::
+ PostEvent(
+ WRTInstallerNS::QuitEvent());
}
Catch(DPL::ZipInput::Exception::OpenFileFailed)
{
printf("failed: widget config file does not exist\n");
LogError("Failed to open config.xml file");
m_returnStatus = -1;
- DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::PostEvent(
- WRTInstallerNS::QuitEvent());
+ DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::
+ PostEvent(
+ WRTInstallerNS::QuitEvent());
}
Catch(ElementParser::Exception::ParseError)
{
printf("failed: can not parse config file\n");
LogError("Failed to parse config.xml file");
m_returnStatus = -1;
- DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::PostEvent(
- WRTInstallerNS::QuitEvent());
+ DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::
+ PostEvent(
+ WRTInstallerNS::QuitEvent());
}
}
if (m_initialized) {
wrt_installer_shutdown();
m_initialized = false;
- DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::PostEvent(
+ DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::
+ PostEvent(
WRTInstallerNS::QuitEvent());
}
}
void WrtInstaller::staticWrtInitCallback(WrtErrStatus status,
- void* userdata)
+ void* userdata)
{
WrtInstaller *This = static_cast<WrtInstaller*>(userdata);
Assert(This);
} else {
LogError("Init unsuccesfull");
This->m_returnStatus = -1;
- This->DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::PostEvent(
+ This->DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::
+ PostEvent(
WRTInstallerNS::QuitEvent());
}
}
DPL::String resultMsg;
std::string printMsg;
- if (current == &WrtInstaller::installStep)
- {
+ if (current == &WrtInstaller::installStep) {
resultMsg = DPL::FromUTF8String(PKGMGR_INSTALL_MSG);
- printMsg = "installed";
+ printMsg = "installation";
} else if (current == &WrtInstaller::uninstallPkgNameStep ||
- current == &WrtInstaller::uninstallGuidStep ||
- current == &WrtInstaller::unistallWgtFileStep)
+ current == &WrtInstaller::unistallWgtFileStep)
{
resultMsg = DPL::FromUTF8String(PKGMGR_UNINSTALL_MSG);
- printMsg = "uninstalled";
+ printMsg = "uninstallation";
}
if (WRT_SUCCESS != status) {
This->m_returnStatus = -1;
if (This->popupsEnabled()) {
- resultMsg += L" : " + DPL::FromUTF8String(PKGMGR_END_FAILURE);
+ resultMsg += L" : " + DPL::FromUTF8String(PKGMGR_END_FAILURE);
This->m_popup->showPopup(This, resultMsg, failResultCallback);
} else {
This->DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>
}
switch (status) {
- case WRT_INSTALLER_ERROR_INVALID_WIDGET_PACKAGE:
+ case WRT_INSTALLER_ERROR_PACKAGE_NOT_FOUND:
This->m_returnStatus = 1; //this status is specific
- printf("failed: invalid widget package\n");
+ fprintf(stderr, "## wrt-installer : %s %s has failed - widget package does not exist\n",
+ tizenId.c_str(), printMsg.c_str());
break;
- case WRT_INSTALLER_ERROR_WIDGET_DOES_NOT_EXIST:
- printf("failed: widget package does not exist\n");
+ case WRT_INSTALLER_ERROR_PACKAGE_INVALID:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - invalid widget package\n",
+ tizenId.c_str(), printMsg.c_str());
break;
- case WRT_INSTALLER_ERROR_ALREADY_UNINSTALLING:
- printf("failed: already uninstalling\n");
+ case WRT_INSTALLER_ERROR_PACKAGE_LOWER_VERSION:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - given"
+ " version is lower than existing version\n",
+ tizenId.c_str(), printMsg.c_str());
break;
- case WRT_INSTALLER_ERROR_OUT_OUT_DISK_SPACE:
- printf("failed: out of disk space\n");
+ case WRT_INSTALLER_ERROR_MANIFEST_NOT_FOUND:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - manifest"
+ " file doesn't find in package.\n",
+ tizenId.c_str(), printMsg.c_str());
break;
- case WRT_INSTALLER_ERROR_INVALID_CERTIFICATE:
- printf("failed: invalid certificate\n");
+ case WRT_INSTALLER_ERROR_MANIFEST_INVALID:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "invalid manifestx.xml\n",
+ tizenId.c_str(), printMsg.c_str());
break;
- case WRT_INSTALLER_ERROR_ALREADY_INSTALLED:
- printf("failed: already installed\n");
+ case WRT_INSTALLER_CONFIG_NOT_FOUND:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "config.xml does not exist\n",
+ tizenId.c_str(), printMsg.c_str());
break;
- case WRT_INSTALLER_ERROR_INTERNAL:
- printf("failed: internal error\n");
+ case WRT_INSTALLER_ERROR_CONFIG_INVALID:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "invalid config.xml\n",
+ tizenId.c_str(), printMsg.c_str());
break;
- case WRT_INSTALLER_ERROR_NOT_ALLOWED:
- printf("failed: installation or update not allowed; invalid"
- " mode\n");
+ case WRT_INSTALLER_ERROR_SIGNATURE_NOT_FOUND:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "signature doesn't exist in package.\n",
+ tizenId.c_str(), printMsg.c_str());
break;
- case WRT_INSTALLER_ERROR_DEFERRED:
- printf("deferred: widget update will continue after the widget"
- " has been stopped\n");
+ case WRT_INSTALLER_ERROR_SIGNATURE_INVALID:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "invalid signature.\n",
+ tizenId.c_str(), printMsg.c_str());
break;
- case WRT_INSTALLER_ERROR_DATABASE_FAILURE:
- printf("failed: database failure\n");
+ case WRT_INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "signature verification failed.\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_ROOT_CERTIFICATE_NOT_FOUND:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "root certificate could not find.\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_CERTIFICATION_INVAID:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "invalid certification.\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "certificate chain verification failed.\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_CERTIFICATE_EXPIRED:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "certificate expired.\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_INVALID_PRIVILEGE:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "invalid privilege\n",
+ tizenId.c_str(), printMsg.c_str());
break;
- case WRT_INSTALLER_ERROR_OSPSVC:
- printf("failed: during installation or uninstallation osp service\n");
+ case WRT_INSTALLER_ERROR_MENU_ICON_NOT_FOUND:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "menu icon could not find\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_FATAL_ERROR:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "fatal error\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_OUT_OF_STORAGE:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "out of storage\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_OUT_OF_MEMORY:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "out of memory\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_PACKAGE_ALREADY_INSTALLED:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "package already installed\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_ACE_CHECK_FAILED:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "ace check failure\n",
+ tizenId.c_str(), printMsg.c_str());
break;
+ case WRT_INSTALLER_ERROR_MANIFEST_CREATE_FAILED:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "to create manifest failed\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_ENCRYPTION_FAILED:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "encryption of resource failed\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_INSTALL_OSP_SERVCIE:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "installation of osp service failed\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+ case WRT_INSTALLER_ERROR_UNINSTALLATION_FAILED:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "widget uninstallation failed\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
+
case WRT_INSTALLER_ERROR_UNKNOWN:
- printf("failed: unknown error\n");
+ fprintf(stderr,"## wrt-installer : %s %s has failed - unknown error\n",
+ tizenId.c_str(), printMsg.c_str());
break;
default:
break;
}
} else {
-
- printf("%s : %s\n", printMsg.c_str(), tizenId.c_str());
+ fprintf(stderr,
+ "## wrt-installer : %s %s was successful.\n",
+ tizenId.c_str(),
+ printMsg.c_str());
LogDebug("Status succesfull");
This->m_returnStatus = 0;
- resultMsg += L" : " + DPL::FromUTF8String(PKGMGR_END_SUCCESS);
+ resultMsg += L" : " + DPL::FromUTF8String(PKGMGR_END_SUCCESS);
if (This->popupsEnabled()) {
This->m_popup->showPopup(This, resultMsg, showResultCallback);
} else {
- This->DPL::Event::ControllerEventHandler<WRTInstallerNS::NextStepEvent>
+ This->DPL::Event::ControllerEventHandler<WRTInstallerNS::
+ NextStepEvent>
::PostEvent(WRTInstallerNS::NextStepEvent());
}
}
}
void WrtInstaller::staticWrtPluginInstallationCallback(WrtErrStatus status,
- void* userdata)
+ void* userdata)
{
Assert(userdata);
if (This->m_numPluginsToInstall < 1) {
LogDebug("All plugins installation completed");
+ fprintf(stderr, "All plugins installation completed.\n");
//remove installation request
if (!PluginUtils::removeInstallationRequiredFlag()) {
} else {
if (This->popupsEnabled()) {
This->m_popup->init();
- float percent = (This->m_totalPlugins - This->m_numPluginsToInstall)/(float)This->m_totalPlugins;
+ float percent =
+ (This->m_totalPlugins -
+ This->m_numPluginsToInstall) / (float)This->m_totalPlugins;
elm_progressbar_value_set(This->m_popup->m_progressbar, percent);
evas_object_show(This->m_popup->m_popup);
}
- This->DPL::Event::ControllerEventHandler<WRTInstallerNS::InstallPluginEvent>::PostEvent(
- WRTInstallerNS::InstallPluginEvent());
+ This->DPL::Event::ControllerEventHandler<WRTInstallerNS::
+ InstallPluginEvent>::
+ PostEvent(
+ WRTInstallerNS::InstallPluginEvent());
}
if (WRT_SUCCESS == status) {
This->m_returnStatus = 0;
+ fprintf(stderr,
+ "## wrt-installer : plugin installation successfull [%s]\n",
+ path.c_str());
LogDebug("One plugin Installation succesfull: " << path);
return;
}
// Failure
LogWarning("One of the plugins installation failed!: " << path);
- if (WRT_PLUGIN_INSTALLER_ERROR_WAITING == status) {
- LogInfo("Plugin installation is waiting for dependencies");
- }
-
switch (status) {
- case WRT_PLUGIN_INSTALLER_ERROR_WRONG_PATH:
- LogError("failed: wrong path to plugin directory\n");
- break;
-
- case WRT_PLUGIN_INSTALLER_ERROR_METAFILE:
- LogError("failed: plugin metafile error\n");
- break;
-
- case WRT_PLUGIN_INSTALLER_ERROR_ALREADY_INSTALLED:
- LogError("failed: plugin already installed\n");
- break;
-
- case WRT_PLUGIN_INSTALLER_ERROR_LIBRARY_ERROR:
- LogError("failed: plugin library: missing symbols or structures\n");
+ case WRT_INSTALLER_ERROR_PLUGIN_INSTALLATION_FAILED:
+ LogError("failed: plugin installation failed\n");
break;
- case WRT_PLUGIN_INSTALLER_ERROR_UNKNOWN:
+ case WRT_INSTALLER_ERROR_UNKNOWN:
LogError("failed: unknown error\n");
break;
}
void WrtInstaller::staticWrtInstallProgressCallback(float percent,
- const char* description, void* userdata)
+ const char* description,
+ void* userdata)
{
WrtInstaller *This = static_cast<WrtInstaller*>(userdata);
- std::stringstream percentStr;
LogInfo(" progress: " << percent <<
" description: " << description);
if (This->popupsEnabled()) {
This->m_popup->init();
- elm_progressbar_value_set(This->m_popup->m_progressbar, percent/100.0);
+ elm_progressbar_value_set(This->m_popup->m_progressbar, percent / 100.0);
evas_object_show(This->m_popup->m_popup);
}
}
void WrtInstaller::staticWrtUninstallProgressCallback(float percent,
- const char* description, void* userdata)
+ const char* description,
+ void* userdata)
{
WrtInstaller *This = static_cast<WrtInstaller*>(userdata);
- std::stringstream percentStr;
LogInfo(" progress: " << percent <<
" description: " << description);
if (This->popupsEnabled()) {
This->m_popup->init();
- elm_progressbar_value_set(This->m_popup->m_progressbar, percent/100.0);
+ elm_progressbar_value_set(This->m_popup->m_progressbar, percent / 100.0);
evas_object_show(This->m_popup->m_popup);
}
}
m_win(NULL),
m_popup(NULL),
m_progressbar(NULL)
-{
-}
+{}
WrtInstaller::InstallerPopup::~InstallerPopup()
{
elm_object_style_set(m_progressbar, "list_progress");
elm_progressbar_horizontal_set(m_progressbar, EINA_TRUE);
evas_object_size_hint_align_set(m_progressbar, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
+ EVAS_HINT_FILL);
evas_object_size_hint_weight_set(m_progressbar, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
elm_object_content_set(m_popup, m_progressbar);
elm_progressbar_value_set(m_progressbar, 0.0);
evas_object_show(m_progressbar);
win = elm_win_add(NULL, name, ELM_WIN_DIALOG_BASIC);
int w, h;
- if(!win)
+ if (!win) {
return NULL;
+ }
elm_win_alpha_set(win, EINA_TRUE);
elm_win_title_set(win, name);
{
Evas_Object *btn;
-
LogDebug("Result Popup Created");
evas_object_del(m_popup);
m_popup = NULL;
m_popup = elm_popup_add(m_win);
- if (!m_popup)
+ if (!m_popup) {
return;
+ }
btn = elm_button_add(m_popup);
if (!btn) {
evas_object_show(m_popup);
evas_object_show(m_win);
-
}
void WrtInstaller::showResultCallback(void *data, Evas_Object* /*obj*/,
// Check and re-set the file open limitation
struct rlimit rlim;
if (getrlimit(RLIMIT_NOFILE, &rlim) != -1) {
- LogDebug("RLIMIT_NOFILE sft(" << rlim.rlim_cur << ")" );
- LogDebug("RLIMIT_NOFILE hrd(" << rlim.rlim_max << ")" );
+ LogDebug("RLIMIT_NOFILE sft(" << rlim.rlim_cur << ")");
+ LogDebug("RLIMIT_NOFILE hrd(" << rlim.rlim_max << ")");
if (rlim.rlim_cur < NOFILE_CNT_FOR_INSTALLER) {
rlim.rlim_cur = NOFILE_CNT_FOR_INSTALLER;