uid_t uid() const { return uid_; }
- std::string unpack_directory() const { return unpack_directory_; }
- void set_unpack_directory(const std::string& unpack_dir) {
- unpack_directory_ = unpack_dir;
+ std::string unpacked_dir_path() const { return unpacked_dir_path_; }
+ void set_unpacked_dir_path(const std::string& dir_path) {
+ unpacked_dir_path_ = dir_path;
}
ConfigData* config_data() const { return config_data_.get(); }
std::string file_path_;
// directory path where app data are temporarily extracted
- std::string unpack_directory_;
+ std::string unpacked_dir_path_;
// data from config.xml
ConfigDataPtr config_data_;
!context_->manifest_data()->uiapplication->next)
install_path /= fs::path(context_->manifest_data()->mainapp_id);
- if (!utils::CopyDir(fs::path(context_->unpack_directory()), install_path)) {
- LOG(ERROR) << "Fail to copy tmp dir: " << context_->unpack_directory()
- << " to dst dir: " << install_path.string();
+ if (!utils::CopyDir(fs::path(context_->unpacked_dir_path()), install_path)) {
+ LOG(ERROR) << "Fail to copy tmp dir: " << context_->unpacked_dir_path()
+ << " to dst dir: " << install_path.string();
return Step::Status::ERROR;
}
- LOG(INFO) << "Successfully copy: " << context_->unpack_directory()
- << " to: " << install_path.string() << " directory";
+ LOG(INFO) << "Successfully copy: " << context_->unpacked_dir_path()
+ << " to: " << install_path.string() << " directory";
return Status::OK;
}
Step::Status StepCopy::clean() {
- LOG(DEBUG) << "Remove tmp dir: " << context_->unpack_directory();
- fs::remove_all(context_->unpack_directory());
+ LOG(DEBUG) << "Remove tmp dir: " << context_->unpacked_dir_path();
+ fs::remove_all(context_->unpacked_dir_path());
return Status::OK;
}
namespace signature {
Step::Status StepSignature::process() {
- return (SignatureValidator::Check(bf::path(context_->unpack_directory()))
+ return (SignatureValidator::Check(bf::path(context_->unpacked_dir_path()))
== SignatureValidator::INVALID) ? Status::ERROR : Status::OK;
}
LOG(ERROR) << "Failed to process unpack step";
return Step::Status::ERROR;
}
- context_->set_unpack_directory(tmp_dir.string());
+ context_->set_unpacked_dir_path(tmp_dir.string());
LOG(INFO) << context_->file_path() << " was successfully unzipped into "
- << context_->unpack_directory();
+ << context_->unpacked_dir_path();
return Status::OK;
}
Step::Status StepUnzip::undo() {
- if (access(context_->unpack_directory().c_str(), F_OK) == 0) {
- boost::filesystem::remove_all(context_->unpack_directory());
- LOG(DEBUG) << "remove temp dir: " << context_->unpack_directory();
+ if (access(context_->unpacked_dir_path().c_str(), F_OK) == 0) {
+ boost::filesystem::remove_all(context_->unpacked_dir_path());
+ LOG(DEBUG) << "remove temp dir: " << context_->unpacked_dir_path();
}
return Status::OK;
}
namespace parse {
common_installer::Step::Status StepParse::process() {
- if (!StepParse::Check(context_->unpack_directory())) {
+ if (!StepParse::Check(context_->unpacked_dir_path())) {
LOG(ERROR) << "No config.xml";
return common_installer::Step::Status::ERROR;
}