X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcommon%2Fstep%2Ffilesystem%2Fstep_remove_per_user_storage_directories.cc;h=1a220a1b3a1f6b1354ba2b87ff23f512c7e77ca3;hb=47a1eb6a0495bae396cffadf3029d0e0f411e2c1;hp=9eba913c11fb857cce0c5dda027e7f0ba6850fbd;hpb=d83fcce6f5e8ae015b9aecca6adda1af5ca210aa;p=platform%2Fcore%2Fappfw%2Fapp-installers.git diff --git a/src/common/step/filesystem/step_remove_per_user_storage_directories.cc b/src/common/step/filesystem/step_remove_per_user_storage_directories.cc index 9eba913..1a220a1 100644 --- a/src/common/step/filesystem/step_remove_per_user_storage_directories.cc +++ b/src/common/step/filesystem/step_remove_per_user_storage_directories.cc @@ -4,11 +4,16 @@ #include "common/step/filesystem/step_remove_per_user_storage_directories.h" +#include #include #include +#include "common/step/step.h" +#include "common/step/filesystem/step_create_storage_directories.h" +#include "common/step/filesystem/step_create_globalapp_symlinks.h" #include "common/installer_context.h" #include "common/shared_dirs.h" +#include "common/utils/pkgmgr_query.h" namespace common_installer { namespace filesystem { @@ -24,6 +29,32 @@ Step::Status StepRemovePerUserStorageDirectories::process() { return Step::Status::OK; } +Step::Status StepRemovePerUserStorageDirectories::undo() { + std::string author_id = + QueryCertificateAuthorCertificate( + context_->pkgid.get(), context_->uid.get()); + context_->certificate_info.get().author_id.set(author_id); + std::vector> steps; + steps.emplace_back(new StepCreateStorageDirectories(context_)); + steps.emplace_back(new StepCreateGlobalAppSymlinks(context_)); + + for (auto& it : steps) { + Step::Status result; + result = it->precheck(); + if (result != Step::Status::OK) { + LOG(ERROR) << "Fail to execute precheck of " << it->name(); + return result; + } + + result = it->process(); + if (result != Step::Status::OK) { + LOG(ERROR) << "Fail to execute process of " << it->name(); + return result; + } + } + return Step::Status::OK; +} + } // namespace filesystem } // namespace common_installer