return true;
}
-bool DeletePerUserStorageDirectories(const std::string& pkgid) {
+bool DeletePerUserStorageDirectories(const std::string& pkgid,
+ bool keep_rwdata) {
// delete skel dir
bf::path skel_apps_rw = bf::path(tzplatform_getenv(TZ_SYS_ETC)) /
bf::path(kSkelAppDir);
return false;
}
+ if (keep_rwdata)
+ return true;
+
// delete per user dir
UserList list = ci::GetUserList();
for (auto l : list) {
* \brief Deletes per user storage directories in path
*
* \param pkgid package id
+ * \param keep_rwdata keep rwdata flag
*
* \return true if succeed, false otherwise
*/
-bool DeletePerUserStorageDirectories(const std::string& pkgid);
+bool DeletePerUserStorageDirectories(const std::string& pkgid,
+ bool keep_rwdata = false);
/**
* \brief Deletes storage directories in path
namespace filesystem {
Step::Status StepRemovePerUserStorageDirectories::process() {
- if (context_->request_mode.get() != RequestMode::GLOBAL ||
- context_->keep_rwdata.get())
+ if (context_->request_mode.get() != RequestMode::GLOBAL)
return Step::Status::OK;
- if (!common_installer::DeletePerUserStorageDirectories(context_->pkgid.get()))
+ if (!common_installer::DeletePerUserStorageDirectories(context_->pkgid.get(),
+ context_->keep_rwdata.get()))
return Status::APP_DIR_ERROR;
return Step::Status::OK;