remove user data directory if preload web app installation failed.
authorSoyoung Kim <sy037.kim@samsung.com>
Tue, 23 Apr 2013 09:26:29 +0000 (18:26 +0900)
committerGerrit Code Review <gerrit2@kim11>
Mon, 29 Apr 2013 14:40:34 +0000 (23:40 +0900)
[Issue#] N/A
[Problem] data directory remained if preload webapp installation failed.
[Cause] N/A
[Solution] remove data directory /opt/usr/apps/[packageid]
[SCMRequest] N/A

Change-Id: I68c9326bac7bce961ad7fd8af76a20a13c1a7b96

src/jobs/widget_install/task_file_manipulation.cpp

index a07944d..4e25780 100644 (file)
@@ -309,6 +309,12 @@ void TaskFileManipulation::StepAbortRenamePath()
             ThrowMsg(Exceptions::RemovingFolderFailure,
                      "Error occurs during removing existing folder");
         }
+        // Remove user data directory if preload web app.
+        std::string userData = m_context.locations->getUserDataRootDir();
+        if (0 == access(userData.c_str(), F_OK)) {
+            WrtUtilRemove(userData);
+        }
+
     }
     LogDebug("Rename widget path sucessful!");
 }