Backup directory in update installation is created per package
not per application (becuase we just copy whole content).
There should be one place which defines how this path is constructed.
Change-Id: I694d4641088acbeccd0cdab04d9e510b16415bf1
delete backend_data.get();
}
+boost::filesystem::path GetBackupPathForPackagePath(
+ const boost::filesystem::path& pkg_path) {
+ fs::path backup_path = pkg_path;
+ backup_path += ".bck";
+ return backup_path;
+}
+
} // namespace common_installer
Property<BackendData*> backend_data;
};
+boost::filesystem::path GetBackupPathForPackagePath(
+ const boost::filesystem::path& pkg_path);
+
} // namespace common_installer
#endif // COMMON_CONTEXT_INSTALLER_H_
!m->uiapplication))
install_path_ /= bf::path(context_->manifest_data.get()->mainapp_id);
- backup_path_ = context_->pkg_path.get();
- backup_path_ += ".bck";
+ backup_path_ = GetBackupPathForPackagePath(context_->pkg_path.get());
// backup old content
if (!utils::MoveDir(context_->pkg_path.get(), backup_path_)) {
const char kSharedLocation[] = "shared";
bool RestoreApplicationStorageForData(const bf::path& pkg_path) {
- bf::path backup_path = pkg_path;
- backup_path += ".bck";
+ bf::path backup_path =
+ common_installer::GetBackupPathForPackagePath(pkg_path);
bs::error_code error_code;
if (!bf::exists(backup_path, error_code)) {