[Release] wrt-installer_0.1.27
authorTaejeong Lee <taejeong.lee@samsung.com>
Tue, 16 Apr 2013 03:02:39 +0000 (12:02 +0900)
committerTaejeong Lee <taejeong.lee@samsung.com>
Tue, 16 Apr 2013 03:02:39 +0000 (12:02 +0900)
Change-Id: Ia6e777c568bbbc66f49ad6f110d986f4c5854a25

configuration/config.tizen.xsd
packaging/wrt-installer.spec
src/CMakeLists.txt
src/jobs/widget_install/job_widget_install.cpp [changed mode: 0644->0755]
src/jobs/widget_install/task_plugins_copy.cpp [deleted file]
src/jobs/widget_install/task_plugins_copy.h [deleted file]

index 0b530b3..b2293d1 100644 (file)
                 <xs:element ref="tizen:pd" minOccurs="0" maxOccurs="1"/>
             </xs:sequence>
             <xs:attribute name="src" use="required" type="xs:anyURI"/>
-            <xs:attribute name="mouse-event" use="optional" type="xs:anyURI"/>
-            <xs:attribute name="touch-effect" use="optional" type="xs:anyURI"/>
+            <xs:attribute name="mouse-event" use="optional" type="tizen:data.boolean"/>
+            <xs:attribute name="touch-effect" use="optional" type="tizen:data.boolean"/>
         </xs:complexType>
     </xs:element>
 
       </xs:complexType>
     </xs:element>
 
-<xs:element name="account">
-    <xs:complexType mixed="true">
-        <xs:sequence>
-            <xs:choice maxOccurs="unbounded">
-                <xs:element ref="tizen:icon" />
-                <xs:element ref="tizen:display-name" />
-                <xs:element name="capability" type="xs:string"/>
-            </xs:choice>
-        </xs:sequence>
-    <xs:attribute name="multiple-account-support" use="required" type="widgets:data.boolean"/>
-    </xs:complexType>
-</xs:element>
-
-<xs:element name="icon">
-  <xs:complexType>
-    <xs:attribute name="section" use="required" type="xs:string"/>
-  </xs:complexType>
-</xs:element>
-
-<xs:element name="display-name">
-  <xs:complexType mixed="true">
-    <xs:attribute ref="xml:lang"/>
-  </xs:complexType>
-</xs:element>
-
 </xs:schema>
index aa7361e..09c60c0 100644 (file)
@@ -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
index 94f836c..bc9962c 100644 (file)
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index fe6103f..f0a72bb
@@ -69,7 +69,6 @@
 #include <widget_install/task_certificates.h>
 #include <widget_install/task_unzip.h>
 #include <widget_install/task_commons.h>
-#include <widget_install/task_plugins_copy.h>
 #include <widget_install/task_prepare_reinstall.h>
 
 #include <widget_install/widget_install_errors.h>
@@ -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 (file)
index f5cad57..0000000
+++ /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 <unistd.h>
-#include "task_plugins_copy.h"
-#include <dpl/log/log.h>
-#include <dpl/string.h>
-#include <dpl/utils/wrt_utility.h>
-#include <dpl/errno_string.h>
-#include <widget_install/job_widget_install.h>
-#include <widget_install_context.h>
-#include <widget_install/widget_install_errors.h>
-#include <dpl/exception.h>
-/* Headers needed for listing directories */
-#include <sys/stat.h>
-#include <dirent.h>
-/* Installation expceptions support */
-#include <dpl/exception.h>
-#include <cerrno>
-
-/* 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<TaskPluginsCopy>(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<std::string>::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 (file)
index 2c9efdd..0000000
+++ /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 <string>
-#include <dpl/task.h>
-#include <dpl/string.h>
-#include <list>
-
-namespace Jobs {
-namespace WidgetInstall {
-class TaskPluginsCopy : public DPL::TaskDecl<TaskPluginsCopy>
-{
-  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<std::string> 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 */