From: Taejeong Lee Date: Tue, 16 Apr 2013 03:02:39 +0000 (+0900) Subject: [Release] wrt-installer_0.1.27 X-Git-Tag: accepted/tizen_2.1/20130425.023916~9 X-Git-Url: http://review.tizen.org/git/?p=framework%2Fweb%2Fwrt-installer.git;a=commitdiff_plain;h=40d6f51bff1caf94365d193163e72187da940390 [Release] wrt-installer_0.1.27 Change-Id: Ia6e777c568bbbc66f49ad6f110d986f4c5854a25 --- diff --git a/configuration/config.tizen.xsd b/configuration/config.tizen.xsd index 0b530b3..b2293d1 100644 --- a/configuration/config.tizen.xsd +++ b/configuration/config.tizen.xsd @@ -158,8 +158,8 @@ - - + + @@ -215,29 +215,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packaging/wrt-installer.spec b/packaging/wrt-installer.spec index aa7361e..09c60c0 100644 --- a/packaging/wrt-installer.spec +++ b/packaging/wrt-installer.spec @@ -1,7 +1,7 @@ -#git:framework/web/wrt-installer wrt-installer 0.1.26 +#git:framework/web/wrt-installer wrt-installer 0.1.27 Name: wrt-installer Summary: Installer for tizen Webruntime -Version: 0.1.26 +Version: 0.1.27 Release: 1 Group: Development/Libraries License: Apache License, Version 2.0 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 94f836c..bc9962c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -77,7 +77,6 @@ SET(INSTALLER_SOURCES ${INSTALLER_JOBS}/widget_install/task_update_files.cpp ${INSTALLER_JOBS}/widget_install/task_remove_backup.cpp ${INSTALLER_JOBS}/widget_install/task_encrypt_resource.cpp - ${INSTALLER_JOBS}/widget_install/task_plugins_copy.cpp ${INSTALLER_JOBS}/widget_install/task_certificates.cpp ${INSTALLER_JOBS}/widget_install/task_prepare_reinstall.cpp ${INSTALLER_JOBS}/widget_install/wac_security.cpp diff --git a/src/jobs/widget_install/job_widget_install.cpp b/src/jobs/widget_install/job_widget_install.cpp old mode 100644 new mode 100755 index fe6103f..f0a72bb --- a/src/jobs/widget_install/job_widget_install.cpp +++ b/src/jobs/widget_install/job_widget_install.cpp @@ -69,7 +69,6 @@ #include #include #include -#include #include #include @@ -209,7 +208,6 @@ JobWidgetInstall::JobWidgetInstall( AddTask(new TaskInstallOspsvc(m_installerContext)); } AddTask(new TaskCertificates(m_installerContext)); - AddTask(new TaskPluginsCopy(m_installerContext)); AddTask(new TaskDatabase(m_installerContext)); AddTask(new TaskAceCheck(m_installerContext)); } else if (result == ConfigureResult::Updated) { @@ -265,7 +263,6 @@ JobWidgetInstall::JobWidgetInstall( { AddTask(new TaskRemoveBackupFiles(m_installerContext)); } - AddTask(new TaskPluginsCopy(m_installerContext)); AddTask(new TaskDatabase(m_installerContext)); AddTask(new TaskAceCheck(m_installerContext)); //TODO: remove widgetHandle from this task and move before database task diff --git a/src/jobs/widget_install/task_plugins_copy.cpp b/src/jobs/widget_install/task_plugins_copy.cpp deleted file mode 100644 index f5cad57..0000000 --- a/src/jobs/widget_install/task_plugins_copy.cpp +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * @file task_plugin_copy.cpp - * @author Marcin Kaminski (marcin.ka@samsung.com) - * @version 1.0 - * @brief Copying plugins delivered in widget package. - */ - -#include -#include "task_plugins_copy.h" -#include -#include -#include -#include -#include -#include -#include -#include -/* Headers needed for listing directories */ -#include -#include -/* Installation expceptions support */ -#include -#include - -/* wrt-installer has to copy plugins for ARM architecture - * when running on target or for i586 architecture if launched - * on SDK emulator. */ -#ifdef __arm__ -const std::string plugins_dir = "arm"; -#else -const std::string plugins_dir = "i586"; -#endif - -namespace { -const std::string PackagePluginsDir = "/plugins/"; -const std::string InstallationPluginsDir = "/data/.netscape/plugins/"; -const mode_t InstallationPluginsDirMode = 0755; -} - -namespace Jobs { -namespace WidgetInstall { -TaskPluginsCopy::TaskPluginsCopy(InstallerContext& context) : - DPL::TaskDecl(this), - m_context(context) -{ - LogDebug("Starting widget plugins copy task"); - AddStep(&TaskPluginsCopy::StepFindPlugins); - AddStep(&TaskPluginsCopy::StepCopyPlugins); - AddStep(&TaskPluginsCopy::StepCopyingFinished); - LogDebug("Widget plugins copy task ended"); - m_npsource = m_context.locations->getSourceDir() + PackagePluginsDir - + plugins_dir; - m_npdestination = m_context.locations->getPackageInstallationDir() - + InstallationPluginsDir; -} - -void TaskPluginsCopy::StepFindPlugins() -{ - LogDebug("Starting plugins finding step"); - /* Check whether plugins directory for actual architecture exists - * (plugins for other architectures are omitted even they exists). */ - if (!WrtUtilDirExists(m_npsource)) { - LogDebug( - "Plugins directory (" << m_npsource - << - ") does not exists - skipping copy step"); - SwitchToStep(&TaskPluginsCopy::StepCopyingFinished); - return; - } - - /* Find all .so files and store their names in list */ - DIR *dir; - struct stat st; - LogDebug("Opening plugins directory"); - dir = opendir(m_npsource.c_str()); - if (dir == NULL) { - LogError("Unable to open plugins directory"); - ThrowMsg(Exceptions::FileOperationFailed, "Unable to read plugins directory"); - } - std::string tempname; - struct dirent entry; - struct dirent *result; - int return_code; - errno = 0; - const std::string ext(".so"); - /* Listing directory and checking entries found inside */ - for (return_code = readdir_r(dir, &entry, &result); - result != NULL && return_code == 0; - return_code = readdir_r(dir, &entry, &result)) - { - tempname = m_npsource + "/" + entry.d_name; - if (lstat(tempname.c_str(), &st) != 0) { - LogWarning( - "Failed to call \"lstat\" (errno:" << errno - << - ") on entry - skipping"); - continue; - } - /* Directories other than "." and ".." should not be found*/ - if (S_ISDIR(st.st_mode)) { - if (strncmp(entry.d_name, "..", 2) != 0 - && strncmp(entry.d_name, ".", 1) != 0) - { - LogError("Directory detected instead of plugin file: " - << entry.d_name); - /* Subdirectories inside plugins/ARCH are not supported */ - if (-1 == TEMP_FAILURE_RETRY(closedir(dir))) { - LogError( - "Failed to close dir: " << m_npsource - << " with error: " << - DPL::GetErrnoString()); - } - ThrowMsg( - Exceptions::PluginsSubdirectory, - "Subdirectories inside plugins directory are not supported"); - } else { - continue; - } - } - - tempname = std::string(entry.d_name); - /* Check whether file extension is ".so" */ - if (tempname.compare(tempname.size() - ext.size(), ext.size(), - ext) == 0) - { - /* Plugin file found */ - LogDebug("Plugin file found: " << tempname); - m_nplugins.push_back(tempname); - } else { - /* Non-.so file found in plugins directory- skipping */ - LogWarning("Non-plugin file found: " << tempname); - } - } - if (return_code != 0 || errno != 0) { - LogError("readdir_r() failed with " << DPL::GetErrnoString()); - } - errno = 0; - if (-1 == TEMP_FAILURE_RETRY(closedir(dir))) { - LogError("Failed to close dir: " << m_npsource << " with error: " - << DPL::GetErrnoString()); - } - /* If no .so files found (list is empty) abort taks*/ - if (m_nplugins.empty()) { - LogError("No valid plugin files found"); - ThrowMsg(Exceptions::EmptyPluginsDirectory, "No valid plugin found"); - } - LogDebug("Number of detected plugins: " << m_nplugins.size()); - LogDebug("Plugins finding step ended"); -} - -void TaskPluginsCopy::StepCopyPlugins() -{ - LogDebug("Starting plugins copying step"); - std::string source; - std::string destination; - - /* Create new directory for plugins (data/.netscape/plugins/) */ - LogDebug("Creating destination plugin directory"); - if (!WrtUtilMakeDir(m_npdestination, InstallationPluginsDirMode)) { - LogError("Failed to create directory for plugins"); - ThrowMsg(Exceptions::FileOperationFailed, - "Failed to create directory for plugins"); - } - - LogDebug("Copying plugins to: " << m_npdestination); - /* Copy plugins from widget package into - * .netscape/plugins in widget's target directory */ - for (std::list::const_iterator it = m_nplugins.begin(); - it != m_nplugins.end(); ++it) - { - LogDebug("Copying plugin file: " << (*it)); - source = m_npsource + "/" + (*it); - destination = m_npdestination + (*it); - if (rename(source.c_str(), destination.c_str()) != 0) { - LogError("Failed to move " << source << " to " << destination); - LogError("(errno: " << errno << ")"); - ThrowMsg(Exceptions::FileOperationFailed, "Failed to copy plugin file"); - } - } - - /* Remove last part of path in source directory path - * (that is "arm" or "i586" depending on architecture) */ - size_t position = m_npsource.find_last_of('/'); - source = m_npsource.substr(0, position); - LogDebug("Removing unnecessary directory: " << source); - /* Remove source directory with plugins (possibly for multiple - * architectures). */ - if (!WrtUtilRemove(source)) { - LogError("Failed to plugins source remove directory"); - ThrowMsg(Exceptions::FileOperationFailed, - "Failed to plugins source remove directory"); - } - LogDebug("Plugins copying step ended"); - - m_context.job->UpdateProgress( - InstallerContext::INSTALL_PLUGINS_COPY, - "Plugins copy"); -} - -void TaskPluginsCopy::StepCopyingFinished() -{ - LogDebug("Plugins copy task finished"); -} -} //namespace WidgetInstall -} //namespace Jobs diff --git a/src/jobs/widget_install/task_plugins_copy.h b/src/jobs/widget_install/task_plugins_copy.h deleted file mode 100644 index 2c9efdd..0000000 --- a/src/jobs/widget_install/task_plugins_copy.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * @file task_plugin_copy.h - * @author Marcin Kaminski (marcin.ka@samsung.com) - * @version 1.0 - * @brief Copying plugins delivered in widget package. - */ - -#ifndef WRT_INSTALLER_SRC_JOBS_WIDGET_INSTALL_TASK_PLUGINS_COPY_H -#define WRT_INSTALLER_SRC_JOBS_WIDGET_INSTALL_TASK_PLUGINS_COPY_H - -class InstallerContext; - -#include -#include -#include -#include - -namespace Jobs { -namespace WidgetInstall { -class TaskPluginsCopy : public DPL::TaskDecl -{ - public: - TaskPluginsCopy(InstallerContext &context); - - private: - /* Widget installer context */ - InstallerContext &m_context; - /* Path to plugins directory in unpacked widget*/ - std::string m_npsource; - /* Path to plugins destination (install) directory */ - std::string m_npdestination; - /* List of found .so files to copy*/ - std::list m_nplugins; - - /* Plugins copying task steps. */ - void StepFindPlugins(); - void StepCopyPlugins(); - void StepCopyingFinished(); -}; -} //namespace WidgetInstall -} //namespace Jobs - -#endif /* WRT_INSTALLER_SRC_JOBS_WIDGET_INSTALL_TASK_PLUGINS_COPY_H */