#include "common/utils/paths.h"
#include "common/tzip_interface.h"
+#include "common/zip_interface.h"
namespace bf = boost::filesystem;
namespace bs = boost::system;
namespace mount {
Step::Status StepUnmount::process() {
- bf::path mount_point = GetMountLocation(context_->GetPkgPath());
- TzipInterface tzip_final(mount_point);
- if (!tzip_final.UnmountZip()) {
+ auto zip_final = CreateZipInterface(
+ GetMountLocation(context_->GetPkgPath()));
+
+ if (!zip_final->UnmountZip()) {
LOG(ERROR) << "Failed to unmount zip package after installation";
return Status::APP_DIR_ERROR;
}
return Status::OK;
}
+std::unique_ptr<IZipInterface> StepUnmount::CreateZipInterface(
+ const boost::filesystem::path& mount_path) {
+ std::unique_ptr<IZipInterface> zip_interface(
+ new TzipInterface(mount_path));
+ return zip_interface;
+}
+
} // namespace mount
} // namespace common_installer
#include <manifest_parser/utils/logging.h>
#include "common/installer_context.h"
+#include "common/mount_base.h"
#include "common/step/step.h"
namespace common_installer {
* \brief Responsible for checking existance of mount path to perform
*
*/
-class StepUnmount : public Step {
+class StepUnmount : public MountBase, public Step {
public:
using Step::Step;
+ using MountBase::MountBase;
Status process() override;
Status clean() override { return Status::OK; }
Status undo() override { return Status::OK; }
Status precheck() override { return Status::OK; }
- STEP_NAME(Unmount)
+ protected:
+ std::unique_ptr<IZipInterface> CreateZipInterface(
+ const boost::filesystem::path& mount_path) override;
+
+ STEP_NAME(Unmount);
};
} // namespace mount