if (context_->external_storage)
context_->external_storage->Commit();
- if (QueryIsPackageInstalled(context_->pkgid.get(), kGlobalUserUid) ||
- context_->keep_rwdata.get()) {
+ bool is_keep_rwdata = false;
+ if (context_->request_mode.get() != RequestMode::GLOBAL) {
+ if (QueryIsPackageInstalled(context_->pkgid.get(), kGlobalUserUid) ||
+ context_->keep_rwdata.get())
+ is_keep_rwdata = true;
+ }
+
+ if (is_keep_rwdata) {
for (bf::directory_iterator itr(pkg_path); itr != bf::directory_iterator();
++itr) {
if (bf::is_directory(itr->status())) {
if (error)
LOG(ERROR) << "Can't remove path:" << itr->path().c_str();
}
-
- if (context_->keep_rwdata.get()) {
- bf::remove_all(pkg_path, error);
- if (error)
- LOG(ERROR) << "Can't remove directory:" <<
- context_->pkg_path.get().c_str();
- }
-
} else {
bf::remove_all(pkg_path, error);
if (error)