// found in the LICENSE file.
#include "common/step/filesystem/step_recover_globalapp_symlinks.h"
-#include "common/step/filesystem/step_remove_globalapp_symlinks.h"
+
+#include "common/shared_dirs.h"
namespace bf = boost::filesystem;
namespace filesystem {
Step::Status StepRecoverGlobalAppSymlinks::RecoveryReadonlyUpdateInstall() {
- StepRemoveGlobalAppSymlinks step(context_);
- Status status = step.precheck();
- if (status != Status::OK)
- return status;
- return step.process();
+ if (!DeleteGlobalAppSymlinksForAllUsers(context_->pkgid.get())) {
+ LOG(ERROR) << "Failed to delete globalapp symlinks";
+ return Status::GLOBALSYMLINK_ERROR;
+ }
+ return Status::OK;
}
} // namespace filesystem
namespace filesystem {
Step::Status StepRemoveGlobalAppSymlinks::process() {
- RequestType req_type = context_->request_type.get();
- if (context_->is_readonly_package.get() && req_type != RequestType::Recovery)
+ if (context_->is_readonly_package.get())
return Step::Status::OK;
if (context_->request_mode.get() != RequestMode::GLOBAL)
std::string package_id = context_->pkgid.get();
+ RequestType req_type = context_->request_type.get();
if (req_type == RequestType::Uninstall ||
- req_type == RequestType::ReadonlyUpdateUninstall ||
- req_type == RequestType::Recovery) {
+ req_type == RequestType::ReadonlyUpdateUninstall) {
LOG(INFO) << "Deleting globalapp symlinks for all user, package: "
<< package_id;
if (!DeleteGlobalAppSymlinksForAllUsers(package_id)) {