From a2d00194d64eb7080d19bacd6c6456e504d64409 Mon Sep 17 00:00:00 2001 From: Grzegorz Rynkowski Date: Thu, 23 May 2013 08:56:57 +0200 Subject: [PATCH] Deferred installation removal. [Issue#] LINUXWRT-161 [Problem] Unused functionality. [Cause] N/A [Solution] Removing it. [Verification] 1. Build a repository. 2. Do a wrt-installer-tests-general after installation new wrt-installer. Compare the new test results with the previous (additionally you could do that for other tests also). Change-Id: Ifb3c1b86a75f42f43582d2d775cb12749c3fed6c --- src/jobs/widget_install/job_widget_install.cpp | 10 +--------- src/jobs/widget_install/job_widget_install.h | 1 - src/jobs/widget_install/widget_install_errors.h | 1 - src/jobs/widget_uninstall/task_check.cpp | 4 ---- src/logic/installer_controller.cpp | 8 -------- src/logic/installer_controller.h | 7 ------- src/logic/installer_logic.cpp | 25 ------------------------- src/logic/installer_logic.h | 3 --- src/wrt-installer/wrt_installer_api.cpp | 6 ------ 9 files changed, 1 insertion(+), 64 deletions(-) diff --git a/src/jobs/widget_install/job_widget_install.cpp b/src/jobs/widget_install/job_widget_install.cpp index 6245ed0..718294d 100644 --- a/src/jobs/widget_install/job_widget_install.cpp +++ b/src/jobs/widget_install/job_widget_install.cpp @@ -122,10 +122,7 @@ class InstallerTaskFail : void StepFail() { - if (m_result == ConfigureResult::Deferred) { - ThrowMsg(Jobs::WidgetInstall::Exceptions::Deferred, - "widget installation or update deferred!"); - } else if (m_result == ConfigureResult::Failed_InvalidConfig) { + if (m_result == ConfigureResult::Failed_InvalidConfig) { ThrowMsg(Jobs::WidgetInstall::Exceptions::WidgetConfigFileInvalid, "invalid config"); } else if (m_result == ConfigureResult::Failed_LowerVersion) { @@ -261,11 +258,6 @@ JobWidgetInstall::JobWidgetInstall( // Any error in acecheck while update will break widget AddTask(new TaskSmack(m_installerContext)); AddTask(new TaskRemoveBackupFiles(m_installerContext)); - } else if (result == ConfigureResult::Deferred) { - // Installation is deferred - LogInfo("Configure installation deferred"); - - AddTask(new InstallerTaskFail(result)); } else if (result >= ConfigureResult::Failed && result <= ConfigureResult::Failed_NotSupportRDSUpdate) { // Installation is not allowed to proceed due to widget update policy diff --git a/src/jobs/widget_install/job_widget_install.h b/src/jobs/widget_install/job_widget_install.h index 7d5862d..2b2f120 100644 --- a/src/jobs/widget_install/job_widget_install.h +++ b/src/jobs/widget_install/job_widget_install.h @@ -40,7 +40,6 @@ namespace WidgetInstall { enum class ConfigureResult { Ok, - Deferred, Updated, Failed, Failed_InvalidConfig, diff --git a/src/jobs/widget_install/widget_install_errors.h b/src/jobs/widget_install/widget_install_errors.h index eb1a25e..653c84d 100644 --- a/src/jobs/widget_install/widget_install_errors.h +++ b/src/jobs/widget_install/widget_install_errors.h @@ -67,7 +67,6 @@ DECLARE_JOB_EXCEPTION(Base, CertificateChainVerificationFailed, ErrorCertificate DECLARE_JOB_EXCEPTION(Base, CertificateExpired, ErrorCertificateExpired) DECLARE_JOB_EXCEPTION(Base, NotAllowed, ErrorFatalError) -DECLARE_JOB_EXCEPTION(Base, Deferred, ErrorFatalError) DECLARE_JOB_EXCEPTION(Base, WidgetRunningError, ErrorFatalError) DECLARE_JOB_EXCEPTION(Base, DRMFailed, ErrorFatalError) DECLARE_JOB_EXCEPTION(Base, DatabaseFailure, ErrorFatalError) diff --git a/src/jobs/widget_uninstall/task_check.cpp b/src/jobs/widget_uninstall/task_check.cpp index bb6a73b..abe6fd2 100644 --- a/src/jobs/widget_uninstall/task_check.cpp +++ b/src/jobs/widget_uninstall/task_check.cpp @@ -43,10 +43,6 @@ TaskCheck::~TaskCheck() void TaskCheck::StepUninstallPreCheck() { - LogInfo("Uninstall check for appid: " << m_context.tzAppid); - //check if deferred - //TODO if widget to be updated, then remove it from Deferred list? - bool isRunning = false; int ret = app_manager_is_running(m_context.tzAppid.c_str(), &isRunning); if (APP_MANAGER_ERROR_NONE != ret) { diff --git a/src/logic/installer_controller.cpp b/src/logic/installer_controller.cpp index 5e65517..552dfae 100644 --- a/src/logic/installer_controller.cpp +++ b/src/logic/installer_controller.cpp @@ -68,14 +68,6 @@ void InstallerController::OnEventReceived( } void InstallerController::OnEventReceived( - const InstallerControllerEvents::InstallDeferredWidgetPackagesEvent & - event) -{ - (void)event; - m_installerLogic.InstallDeferredWidgetPackages(); -} - -void InstallerController::OnEventReceived( const InstallerControllerEvents::InitializeEvent & /*event*/) { m_installerLogic.Initialize(); diff --git a/src/logic/installer_controller.h b/src/logic/installer_controller.h index ca4cc6b..3fa7964 100644 --- a/src/logic/installer_controller.h +++ b/src/logic/installer_controller.h @@ -63,8 +63,6 @@ DECLARE_GENERIC_EVENT_2(UninstallWidgetEvent, */ DECLARE_GENERIC_EVENT_1(NextStepEvent, Jobs::Job *) -DECLARE_GENERIC_EVENT_0(InstallDeferredWidgetPackagesEvent) - DECLARE_GENERIC_EVENT_0(InitializeEvent) DECLARE_GENERIC_EVENT_0(TerminateEvent) } // namespace InstallerEvents @@ -88,7 +86,6 @@ typedef DPL::TypeListDecl< InstallerControllerEvents::InstallPluginEvent, InstallerControllerEvents::UninstallWidgetEvent, InstallerControllerEvents::NextStepEvent, - InstallerControllerEvents::InstallDeferredWidgetPackagesEvent, InstallerControllerEvents::InitializeEvent, InstallerControllerEvents::TerminateEvent>::Type InstallerControllerEventsSet; @@ -121,10 +118,6 @@ class InstallerController : public DPL::Event::Controller< const InstallerControllerEvents::NextStepEvent &event); virtual void OnEventReceived( - const InstallerControllerEvents::InstallDeferredWidgetPackagesEvent - &event); - - virtual void OnEventReceived( const InstallerControllerEvents::InitializeEvent &event); virtual void OnEventReceived( const InstallerControllerEvents::TerminateEvent &event); diff --git a/src/logic/installer_logic.cpp b/src/logic/installer_logic.cpp index aa9061c..10cda89 100644 --- a/src/logic/installer_logic.cpp +++ b/src/logic/installer_logic.cpp @@ -172,31 +172,6 @@ bool InstallerLogic::NextStep(Jobs::Job *job) } } -//TODO this should be moved somewhere...when it should take place? after widget -//is closing? -void InstallerLogic::InstallDeferredWidgetPackages() -{ - LogWarning("Not implemented"); - // LogInfo("Installing deferred widget packages..."); - // - // WidgetPackageList packages = - // GlobalDAO::GetDefferedWidgetPackageInstallationList(); - // - // LogInfo(packages.size() << " widget package(s) to install"); - // - // // Make a copy of widget packages to install, because some - // // widget packages may still fail because they are running - // m_packagesToInstall = packages; - // - // // Start processing - // InstallSingleDeferredPackage(); -} - -void InstallerLogic::InstallSingleDeferredPackage() -{ - LogWarning("Not implemented"); -} - void InstallerLogic::InstallWaitingPlugins() { PluginHandleSetPtr waitingPlugins; diff --git a/src/logic/installer_logic.h b/src/logic/installer_logic.h index 5072e39..496e967 100644 --- a/src/logic/installer_logic.h +++ b/src/logic/installer_logic.h @@ -30,9 +30,6 @@ class InstallerLogic typedef std::map JobsContainer; JobsContainer m_jobs; - void InstallDeferredWidgetPackages(); - void InstallSingleDeferredPackage(); - void ResetProgressPlugins(); void InstallWaitingPlugins(); bool resolvePluginDependencies(PluginHandle handle); diff --git a/src/wrt-installer/wrt_installer_api.cpp b/src/wrt-installer/wrt_installer_api.cpp index 83b5172..5b4e9f9 100644 --- a/src/wrt-installer/wrt_installer_api.cpp +++ b/src/wrt-installer/wrt_installer_api.cpp @@ -122,12 +122,6 @@ void wrt_installer_init(void *userdata, InstallerControllerEvents:: InitializeEvent()); - // Install deferred widget packages - CONTROLLER_POST_EVENT( - Logic::InstallerController, - InstallerControllerEvents:: - InstallDeferredWidgetPackagesEvent()); - if (callback) { LogInfo("[WRT-API] WRT INSTALLER INITIALIZATION CALLBACK"); callback(WRT_SUCCESS, userdata); -- 2.7.4