#include "common/step/filesystem/step_recover_external_storage.h"
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
+#include <boost/system/error_code.hpp>
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+
namespace common_installer {
namespace filesystem {
Step::Status StepRecoverExternalStorage::process() {
- (void) StepAcquireExternalStorage::process();
+ if (!context_->manifest_data.get()) {
+ bs::error_code error;
+ if (bf::exists(context_->pkg_path.get())) {
+ bf::remove_all(context_->pkg_path.get(), error);
+ }
+ } else {
+ (void) StepAcquireExternalStorage::process();
+ }
return Status::OK;
}