[Release] wrt-installer_0.1.123 submit/tizen_2.2/20130911.125331
authorsung-su.kim <sung-su.kim@samsung.com>
Wed, 11 Sep 2013 12:53:18 +0000 (21:53 +0900)
committersung-su.kim <sung-su.kim@samsung.com>
Wed, 11 Sep 2013 12:53:18 +0000 (21:53 +0900)
Change-Id: If24f11d6fd695fdcb599e9bc13d00718278f397e

17 files changed:
packaging/wrt-installer.spec
src/CMakeLists.txt
src/jobs/widget_install/directory_api.cpp
src/jobs/widget_install/manifest.cpp
src/jobs/widget_install/manifest.h
src/jobs/widget_install/task_certify.cpp
src/jobs/widget_install/task_manifest_file.cpp
src/jobs/widget_install/task_manifest_file.h
src/jobs/widget_uninstall/job_widget_uninstall.cpp
src/jobs/widget_uninstall/task_db_update.cpp
src/jobs/widget_uninstall/task_db_update.h
src/jobs/widget_uninstall/task_delete_certificates.cpp [deleted file]
src/jobs/widget_uninstall/task_delete_pkginfo.cpp [new file with mode: 0644]
src/jobs/widget_uninstall/task_delete_pkginfo.h [moved from src/jobs/widget_uninstall/task_delete_certificates.h with 73% similarity]
src/jobs/widget_uninstall/task_remove_files.cpp
src/jobs/widget_uninstall/task_remove_files.h
src/pkg-manager/pkgmgr_signal.h

index dde259b..f5427c4 100644 (file)
@@ -1,7 +1,7 @@
 #git:framework/web/wrt-installer
 Name:       wrt-installer
 Summary:    Installer for tizen Webruntime
-Version:    0.1.121
+Version:    0.1.123
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 794e7f1..87de01c 100644 (file)
@@ -92,7 +92,7 @@ SET(INSTALLER_SOURCES
     ${INSTALLER_JOBS}/widget_uninstall/task_db_update.cpp
     ${INSTALLER_JOBS}/widget_uninstall/task_smack.cpp
     ${INSTALLER_JOBS}/widget_uninstall/task_uninstall_ospsvc.cpp
-    ${INSTALLER_JOBS}/widget_uninstall/task_delete_certificates.cpp
+    ${INSTALLER_JOBS}/widget_uninstall/task_delete_pkginfo.cpp
     ${INSTALLER_SRC_DIR}/logic/installer_logic.cpp
     ${INSTALLER_SRC_DIR}/logic/installer_controller.cpp
     ${INSTALLER_SRC_DIR}/misc/wac_widget_id.cpp
index a43b24c..5edcf4c 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <directory_api.h>
 #include <sys/stat.h>
+#include <unistd.h>
 #include <dirent.h>
 #include <fstream>
 #include <dpl/log/log.h>
index 80b37b0..49658c2 100644 (file)
@@ -153,6 +153,7 @@ void Manifest::serialize(xmlTextWriterPtr writer)
         writeAttribute(writer, "xmlns", "http://tizen.org/ns/packages");
         writeAttribute(writer, "package", this->package);
         writeAttribute(writer, "type", this->type);
+        writeAttribute(writer, "root_path", this->rootPath);
         writeAttribute(writer, "version", this->version);
         if (!this->installLocation.IsNull()) {
             writeAttribute(writer, "install-location", (*this->installLocation));
index 67ee3ce..d926c7e 100644 (file)
@@ -75,7 +75,7 @@ typedef StringWithLang LabelType, IconType, DescriptionType;
  * errors (related to usage of not allowed characters in given places).
  */
 typedef DPL::String NcnameType, NmtokenType, AnySimpleType, LangType;
-typedef DPL::String OperationType, MimeType, UriType, TypeType, PackageType;
+typedef DPL::String OperationType, MimeType, UriType, TypeType, PackageType, RootPathType;
 typedef DPL::OptionalString InstallLocationType, CategoriesType;
 typedef DPL::String AppCategoryType;
 typedef DPL::OptionalString KeyType, ValueType;
@@ -554,6 +554,10 @@ class Manifest
     {
         this->version = x;
     }
+    void setRootPath(const RootPathType &x)
+    {
+        this->rootPath = x;
+    }
     void setStoreClientId(const NcnameType &x)
     {
         this->storeClientId= x;
@@ -575,6 +579,7 @@ class Manifest
     NcnameType package;
     PackageType type;
     NmtokenType version;
+    RootPathType rootPath;
     std::list<Account> account;
     PrivilegeType privileges;
     NcnameType storeClientId;
index a610cb6..1c3e75e 100644 (file)
@@ -24,6 +24,7 @@
 #include <cstring>
 #include <string>
 #include <sstream>
+#include <unistd.h>
 #include <dpl/assert.h>
 #include <appcore-common.h> //TODO is it necessary here?
 #include <pcrecpp.h>
index 8308125..03fa597 100644 (file)
@@ -186,6 +186,23 @@ void TaskManifestFile::stepCreateExecFile()
                     << "[" <<  DPL::GetErrnoString(error) << "]");
     }
 #endif
+
+    // creation of box symlink
+    ConfigParserData::LiveboxList& liveboxList =
+        m_context.widgetConfig.configInfo.m_livebox;
+    if (!liveboxList.empty()) {
+        std::string boxExec = "/usr/bin/WebProcess";
+        std::string boxSymlink = m_context.locations->getExecFile();
+        boxSymlink += ".d-box";
+
+        if (symlink(boxExec.c_str(), boxSymlink.c_str()) != 0) {
+            if (errno) {
+                LogPedantic("Failed to make a symbolic name for a file "
+                        << "[" <<  DPL::GetErrnoString(errno) << "]");
+            }
+        }
+    }
+
     m_context.job->UpdateProgress(
             InstallerContext::INSTALL_CREATE_EXECFILE,
             "Widget execfile creation Finished");
@@ -320,7 +337,7 @@ void TaskManifestFile::stepCopyLiveboxFiles()
             targetFile << (**boxIt).m_liveboxId << ".";
             targetFile << DPL::ToUTF8String((*sizeIt).m_size) << "." << DEFAULT_PREVIEW_NAME;
 
-            DynamicBoxFileCopy(sourceFile.str(), targetFile.str());
+            copyDynamicBoxFile(sourceFile.str(), targetFile.str());
 
             // clear stream objects
             sourceFile.str("");
@@ -336,7 +353,7 @@ void TaskManifestFile::stepCopyLiveboxFiles()
         targetFile << m_context.locations->getSharedDataDir() << "/";
         targetFile << (**boxIt).m_liveboxId << "." << DEFAULT_ICON_NAME;
 
-        DynamicBoxFileCopy(sourceFile.str(), targetFile.str());
+        copyDynamicBoxFile(sourceFile.str(), targetFile.str());
 
         // clear stream objects
         sourceFile.str("");
@@ -347,7 +364,7 @@ void TaskManifestFile::stepCopyLiveboxFiles()
         "Livebox files copy Finished");
 }
 
-void TaskManifestFile::DynamicBoxFileCopy(const std::string& sourceFile,
+void TaskManifestFile::copyDynamicBoxFile(const std::string& sourceFile,
                                           const std::string& targetFile)
 {
     Try
@@ -364,6 +381,41 @@ void TaskManifestFile::DynamicBoxFileCopy(const std::string& sourceFile,
     }
 }
 
+bool TaskManifestFile::addBoxUiApplication(Manifest& manifest)
+{
+    UiApplication uiApp;
+    std::string postfix = ".d-box";
+    static bool isAdded = false;
+
+    Try
+    {
+        if (isAdded) {
+            LogDebug("UiApplication for d-box is already added");
+            return false;
+        }
+        uiApp.setNodisplay(true);
+        uiApp.setTaskmanage(false);
+        uiApp.setMultiple(false);
+        setWidgetName(manifest, uiApp);
+        setWidgetIcons(uiApp);
+
+        // appid for box is like [webapp id].d-box
+        setWidgetIds(manifest, uiApp, postfix);
+        // executable path for box is like [app path]/bin/[webapp id].d-box
+        setWidgetExecPath(uiApp, postfix);
+        manifest.addUiApplication(uiApp);
+        isAdded = true;
+
+        return true;
+    }
+    Catch(DPL::Exception)
+    {
+        LogError("Adding UiApplication on xml is failed.");
+        isAdded = false;
+        return false;
+    }
+}
+
 void TaskManifestFile::stepBackupIconFiles()
 {
     LogDebug("Backup Icon Files");
@@ -888,6 +940,8 @@ void TaskManifestFile::generateWidgetDescription(Manifest & manifest,
 void TaskManifestFile::setWidgetManifest(Manifest & manifest)
 {
     manifest.setPackage(m_context.widgetConfig.tzPkgid);
+    manifest.setRootPath(DPL::FromUTF8String(
+                m_context.locations->getPackageInstallationDir()));
 
     if (!!m_context.widgetConfig.version) {
         manifest.setVersion(*m_context.widgetConfig.version);
@@ -997,7 +1051,20 @@ void TaskManifestFile::setMetadata(UiApplication &uiApp)
 
 void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
 {
-    FOREACH(it, m_context.widgetConfig.configInfo.m_livebox) {
+    ConfigParserData::LiveboxList& liveboxList =
+        m_context.widgetConfig.configInfo.m_livebox;
+
+    if (liveboxList.empty()) {
+        LogDebug("no livebox");
+        return;
+    }
+
+    if (!addBoxUiApplication(manifest)) {
+        LogDebug("error during adding UiApplication for d-box");
+        return;
+    }
+
+    FOREACH(it, liveboxList) {
         LogDebug("setLiveBoxInfo");
         LiveBoxInfo liveBox;
         DPL::Optional<WrtDB::ConfigParserData::LiveboxInfo> ConfigInfo = *it;
index 98c3d23..dee925d 100644 (file)
@@ -120,8 +120,9 @@ class TaskManifestFile :
                             const DPL::OptionalString& tag,
                             const DPL::String& language, const std::string &extension,
                             bool & defaultIconSaved);
-    void DynamicBoxFileCopy(const std::string& sourceFile,
+    void copyDynamicBoxFile(const std::string& sourceFile,
                             const std::string& targetFile);
+    bool addBoxUiApplication(Manifest& manifest);
 
     //for widget update
     void backupIconFiles();
index b5e978e..563f10a 100644 (file)
@@ -24,7 +24,7 @@
 #include <widget_uninstall/task_remove_custom_handlers.h>
 #include <widget_uninstall/task_smack.h>
 #include <widget_uninstall/task_uninstall_ospsvc.h>
-#include <widget_uninstall/task_delete_certificates.h>
+#include <widget_uninstall/task_delete_pkginfo.h>
 #include <dpl/wrt-dao-ro/global_config.h>
 #include <pkg-manager/pkgmgr_signal.h>
 #include <app2ext_interface.h>
@@ -105,17 +105,6 @@ JobWidgetUninstall::JobWidgetUninstall(
 
             LogDebug("Widget model exists. App id : " << m_context.tzAppid);
 
-            AddTask(new TaskSmack(m_context));
-            AddTask(new TaskCheck(m_context));
-
-            if (dao.getPackagingType() == PKG_TYPE_HYBRID_WEB_APP) {
-                AddTask(new TaskUninstallOspsvc(m_context));
-            }
-            AddTask(new TaskRemoveFiles(m_context));
-            AddTask(new TaskDbUpdate(m_context));
-            AddTask(new TaskRemoveCustomHandlers(m_context));
-            AddTask(new TaskDeleteCertificates(m_context));
-
             // send start signal of pkgmgr
             if (getInstallerStruct().pkgmgrInterface->setPkgname(m_context.tzPkgid))
             {
@@ -123,6 +112,17 @@ JobWidgetUninstall::JobWidgetUninstall(
                         PKGMGR_START_KEY,
                         PKGMGR_START_UNINSTALL);
             }
+
+            AddTask(new TaskCheck(m_context));
+            AddTask(new TaskDeletePkgInfo(m_context));
+            AddTask(new TaskDbUpdate(m_context));
+            AddTask(new TaskSmack(m_context));
+
+            if (dao.getPackagingType() == PKG_TYPE_HYBRID_WEB_APP) {
+                AddTask(new TaskUninstallOspsvc(m_context));
+            }
+            AddTask(new TaskRemoveCustomHandlers(m_context));
+            AddTask(new TaskRemoveFiles(m_context));
         } else if (WidgetStatus::NOT_INSTALLED == status ||
                 WidgetStatus::PREALOAD == status) {
             AddTask(new UninstallerTaskFail(status));
index ee4362c..a7c0d42 100644 (file)
@@ -25,6 +25,8 @@
 #include <widget_uninstall/job_widget_uninstall.h>
 #include <widget_uninstall/widget_uninstall_errors.h>
 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <dpl/utils/wrt_utility.h>
+#include <dpl/utils/path.h>
 #include <ace_api_install.h>
 #include <dpl/assert.h>
 #include <ace-common/ace_api_common.h>
@@ -38,6 +40,7 @@ TaskDbUpdate::TaskDbUpdate(UninstallerContext& context) :
     m_context(context)
 {
     AddStep(&TaskDbUpdate::StartStep);
+    AddStep(&TaskDbUpdate::StepRemoveExternalLocations);
     AddStep(&TaskDbUpdate::StepDbUpdate);
     AddStep(&TaskDbUpdate::StepLiveboxDBDelete);
     AddStep(&TaskDbUpdate::EndStep);
@@ -80,6 +83,40 @@ void TaskDbUpdate::StepLiveboxDBDelete()
     }
 }
 
+void TaskDbUpdate::StepRemoveExternalLocations()
+{
+    if (!m_context.removeAbnormal) {
+        WidgetDAO dao(DPL::FromUTF8String(m_context.tzAppid));
+        LogDebug("Removing external locations:");
+        WrtDB::ExternalLocationList externalPaths = dao.getWidgetExternalLocations();
+        FOREACH(file, externalPaths)
+        {
+            DPL::Utils::Path path(*file);
+            if(path.Exists()){
+                if(path.IsFile()){
+                    LogDebug("  -> " << path.Fullpath());
+                    Try{
+                        DPL::Utils::Remove(path);
+                    }Catch(DPL::Utils::Path::BaseException){
+                        LogError("Failed to remove the file: " << path.Fullpath());
+                    }
+                } else if (path.IsDir()){
+                    LogDebug("  -> " << path.Fullpath());
+                    Try{
+                        DPL::Utils::Remove(path);
+                    }Catch(DPL::Utils::Path::BaseException){
+                        Throw(Jobs::WidgetUninstall::TaskDbUpdate::
+                                Exception::RemoveFilesFailed);
+                    }
+                }
+            }else{
+                LogWarning("  -> " << path.Fullpath() << "(no such a path)");
+            }
+        }
+        dao.unregisterAllExternalLocations();
+    }
+}
+
 void TaskDbUpdate::StartStep()
 {
     LogDebug("--------- <TaskDbUpdate> : START ----------");
index 1d2b453..122b03f 100644 (file)
@@ -40,6 +40,7 @@ class TaskDbUpdate :
       public:
         DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
         DECLARE_EXCEPTION_TYPE(Base, DbStepFailed)
+        DECLARE_EXCEPTION_TYPE(Base, RemoveFilesFailed)
     };
 
     UninstallerContext& m_context;
@@ -47,6 +48,7 @@ class TaskDbUpdate :
   private:
     void StepDbUpdate();
     void StepLiveboxDBDelete();
+    void StepRemoveExternalLocations();
 
     void StartStep();
     void EndStep();
diff --git a/src/jobs/widget_uninstall/task_delete_certificates.cpp b/src/jobs/widget_uninstall/task_delete_certificates.cpp
deleted file mode 100644 (file)
index 1c38eca..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2011 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_delete_certificates.cpp
- * @author  Leerang Song(leerang.song@samsung.com)
- * @version 1.0
- * @brief   Implementation file for uninstaller delete certi info from pkgmgr
- */
-
-#include <widget_uninstall/task_delete_certificates.h>
-#include <widget_uninstall/job_widget_uninstall.h>
-#include <widget_uninstall/widget_uninstall_errors.h>
-#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
-#include <pkgmgr_installer.h>
-#include <dpl/assert.h>
-
-namespace Jobs {
-namespace WidgetUninstall {
-TaskDeleteCertificates::TaskDeleteCertificates(
-    UninstallerContext& context) :
-    DPL::TaskDecl<TaskDeleteCertificates>(this),
-    m_context(context)
-{
-    AddStep(&TaskDeleteCertificates::StartStep);
-    AddStep(&TaskDeleteCertificates::StepDeleteCertificates);
-    AddStep(&TaskDeleteCertificates::EndStep);
-}
-
-TaskDeleteCertificates::~TaskDeleteCertificates()
-{}
-
-void TaskDeleteCertificates::StepDeleteCertificates()
-{
-    if ((pkgmgr_installer_delete_certinfo(
-             const_cast<char*>((m_context.tzAppid).c_str()))) < 0)
-    {
-        LogError("pkgmgr_installer_delete_certinfo fail");
-    }
-}
-
-void TaskDeleteCertificates::StartStep()
-{
-    LogDebug("--------- <TaskDeleteCertificates> : START ----------");
-}
-
-void TaskDeleteCertificates::EndStep()
-{
-    LogDebug("--------- <TaskDeleteCertificates> : END ----------");
-}
-} //namespace WidgetUninstall
-} //namespace Jobs
diff --git a/src/jobs/widget_uninstall/task_delete_pkginfo.cpp b/src/jobs/widget_uninstall/task_delete_pkginfo.cpp
new file mode 100644 (file)
index 0000000..838a9fd
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2011 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_delete_pkginfo.cpp
+ * @author  Leerang Song(leerang.song@samsung.com)
+ * @version 1.0
+ * @brief   Implementation file for uninstaller delete package information
+ */
+
+#include <string.h>
+#include <widget_uninstall/task_delete_pkginfo.h>
+#include <widget_uninstall/job_widget_uninstall.h>
+#include <widget_uninstall/widget_uninstall_errors.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <pkgmgr/pkgmgr_parser.h>
+#include <dpl/assert.h>
+#include <dpl/utils/wrt_utility.h>
+#include <dpl/utils/path.h>
+
+namespace Jobs {
+namespace WidgetUninstall {
+TaskDeletePkgInfo::TaskDeletePkgInfo(
+    UninstallerContext& context) :
+    DPL::TaskDecl<TaskDeletePkgInfo>(this),
+    m_context(context)
+{
+    AddStep(&TaskDeletePkgInfo::StartStep);
+    AddStep(&TaskDeletePkgInfo::StepDeletePkgInfo);
+    AddStep(&TaskDeletePkgInfo::EndStep);
+}
+
+void TaskDeletePkgInfo::StartStep()
+{
+    LogDebug("--------- <TaskDeletePkgInfo> : START ----------");
+}
+
+void TaskDeletePkgInfo::EndStep()
+{
+    LogDebug("--------- <TaskDeletePkgInfo> : END ----------");
+}
+
+void TaskDeletePkgInfo::StepDeletePkgInfo()
+{
+    std::ostringstream manifest_name;
+    manifest_name << m_context.tzPkgid << ".xml";
+    DPL::Utils::Path destFile;
+    const DPL::Utils::Path PRELOAD_INSTALLED_PATH("/usr/apps");
+    const DPL::Utils::Path USR_PACKAGES_PATH("/usr/share/packages");
+    const DPL::Utils::Path OPT_PACKAGES_PATH("/opt/share/packages");
+    if (0 == (m_context.installedPath.Fullpath()).compare(0,
+            PRELOAD_INSTALLED_PATH.Fullpath().length(),
+            PRELOAD_INSTALLED_PATH.Fullpath())) {
+        LogDebug("This widget is preloaded.");
+        destFile = USR_PACKAGES_PATH;
+    } else {
+        destFile = OPT_PACKAGES_PATH;
+    }
+    destFile /= manifest_name.str();
+    DPL::Utils::Path pre_manifest = USR_PACKAGES_PATH;
+    pre_manifest /= manifest_name.str();
+
+    if (!(destFile.Exists() == 0 && pre_manifest.Exists())) {
+        if (0 !=  pkgmgr_parser_parse_manifest_for_uninstallation(
+                    destFile.Fullpath().c_str(), NULL)) {
+            LogWarning("Manifest file failed to parse for uninstallation");
+        }
+    }
+    if (!DPL::Utils::TryRemove(destFile)) {
+        LogWarning("No manifest file found: " << destFile.Fullpath());
+    } else {
+        LogDebug("Manifest file removed: " << destFile.Fullpath());
+    }
+}
+} //namespace WidgetUninstall
+} //namespace Jobs
  *    limitations under the License.
  */
 /**
- * @file    task_delete_certificates.h
+ * @file    task_delete_pkginfo.h
  * @author  Leerang Song(leerang.song@samsung.com)
  * @version 1.0
- * @brief   Header file for uninstaller task delete certi info from pkgmgr
+ * @brief   Header file for uninstaller task delete package infomation
  */
 
-#ifndef WRT_SRC_INSTALLER_CORE_JOB_WIDGET_UNINSTALL_TASK_DELETE_CERTIFICATES_H_
-#define WRT_SRC_INSTALLER_CORE_JOB_WIDGET_UNINSTALL_TASK_DELETE_CERTIFICATES_H_
+#ifndef WRT_SRC_INSTALLER_CORE_JOB_WIDGET_UNINSTALL_TASK_DELETE_PKGINFO_H_
+#define WRT_SRC_INSTALLER_CORE_JOB_WIDGET_UNINSTALL_TASK_DELETE_PKGINFO_H_
 
 #include <dpl/task.h>
 
 
 namespace Jobs {
 namespace WidgetUninstall {
-class TaskDeleteCertificates :
-    public DPL::TaskDecl<TaskDeleteCertificates>
+class TaskDeletePkgInfo :
+    public DPL::TaskDecl<TaskDeletePkgInfo>
 {
     UninstallerContext& m_context;
 
   private:
-    void StepDeleteCertificates();
+    void StepDeletePkgInfo();
 
     void StartStep();
     void EndStep();
 
   public:
-    TaskDeleteCertificates(UninstallerContext& context);
-    virtual ~TaskDeleteCertificates();
+    TaskDeletePkgInfo(UninstallerContext& context);
 };
 } //namespace WidgetUninstall
 } //namespace Jobs
 
 #endif
-// WRT_SRC_INSTALLER_CORE_JOB_WIDGET_UNINSTALL_TASK_DELETE_CERTIFICATES_H_
+// WRT_SRC_INSTALLER_CORE_JOB_WIDGET_UNINSTALL_TASK_DELETE_PKGINFO_H_
index 0a8f5c3..c02f0a9 100644 (file)
@@ -47,8 +47,6 @@ TaskRemoveFiles::TaskRemoveFiles(UninstallerContext& context) :
 {
     AddStep(&TaskRemoveFiles::StartStep);
     AddStep(&TaskRemoveFiles::StepRemoveInstallationDirectory);
-    AddStep(&TaskRemoveFiles::StepRemoveManifest);
-    AddStep(&TaskRemoveFiles::StepRemoveExternalLocations);
     AddStep(&TaskRemoveFiles::StepRemoveFinished);
     AddStep(&TaskRemoveFiles::EndStep);
 }
@@ -111,74 +109,6 @@ void TaskRemoveFiles::StepRemoveFinished()
         "Widget remove steps Finished");
 }
 
-void TaskRemoveFiles::StepRemoveManifest()
-{
-    std::ostringstream manifest_name;
-    manifest_name << m_context.tzPkgid << ".xml";
-    DPL::Utils::Path destFile;
-    const DPL::Utils::Path PRELOAD_INSTALLED_PATH("/usr/apps");
-    const DPL::Utils::Path USR_PACKAGES_PATH("/usr/share/packages");
-    const DPL::Utils::Path OPT_PACKAGES_PATH("/opt/share/packages");
-    if (0 == (m_context.installedPath.Fullpath()).compare(0,
-            PRELOAD_INSTALLED_PATH.Fullpath().length(),
-            PRELOAD_INSTALLED_PATH.Fullpath())) {
-        LogDebug("This widget is preloaded.");
-        destFile = USR_PACKAGES_PATH;
-    } else {
-        destFile = OPT_PACKAGES_PATH;
-    }
-    destFile /= manifest_name.str();
-    DPL::Utils::Path pre_manifest = USR_PACKAGES_PATH;
-    pre_manifest /= manifest_name.str();
-
-    if (!(destFile.Exists() == 0 && pre_manifest.Exists())) {
-        int ret1 = pkgmgr_parser_parse_manifest_for_uninstallation(
-                destFile.Fullpath().c_str(), NULL);
-        if (ret1 != 0) {
-            LogWarning("Manifest file failed to parse for uninstallation");
-        }
-    }
-    if (!DPL::Utils::TryRemove(destFile)) {
-        LogWarning("No manifest file found: " << destFile.Fullpath());
-    } else {
-        LogDebug("Manifest file removed: " << destFile.Fullpath());
-    }
-}
-
-void TaskRemoveFiles::StepRemoveExternalLocations()
-{
-    if (!m_context.removeAbnormal) {
-        WidgetDAO dao(DPL::FromUTF8String(m_context.tzAppid));
-        LogDebug("Removing external locations:");
-        WrtDB::ExternalLocationList externalPaths = dao.getWidgetExternalLocations();
-        FOREACH(file, externalPaths)
-        {
-            DPL::Utils::Path path(*file);
-            if(path.Exists()){
-                if(path.IsFile()){
-                    LogDebug("  -> " << path.Fullpath());
-                    Try{
-                        DPL::Utils::Remove(path);
-                    }Catch(DPL::Utils::Path::BaseException){
-                        LogError("Failed to remove the file: " << path.Fullpath());
-                    }
-                } else if (path.IsDir()){
-                    LogDebug("  -> " << path.Fullpath());
-                    Try{
-                        DPL::Utils::Remove(path);
-                    }Catch(DPL::Utils::Path::BaseException){
-                        Throw(Jobs::WidgetUninstall::TaskRemoveFiles::
-                                Exception::RemoveFilesFailed);
-                    }
-                }
-            }else{
-                LogWarning("  -> " << path.Fullpath() << "(no such a path)");
-            }
-        }
-        dao.unregisterAllExternalLocations();
-    }
-}
-
 void TaskRemoveFiles::StartStep()
 {
     LogDebug("--------- <TaskRemoveFiles> : START ----------");
index 19db96a..276fb24 100644 (file)
@@ -48,9 +48,6 @@ class TaskRemoveFiles :
   private:
     void StepRemoveInstallationDirectory();
     void StepRemoveFinished();
-    void StepRemoveDesktop();
-    void StepRemoveManifest();
-    void StepRemoveExternalLocations();
 
     void StartStep();
     void EndStep();
index 410459e..e44ae82 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifndef WRT_PKGMGR_SIGNAL_H_
-#define WRT_PKGMGR_SINGAL_H_
+#define WRT_PKGMGR_SIGNAL_H_
 
 #include <pkg-manager/pkgmgr_signal_interface.h>
 #include <pkgmgr_installer.h>