return Step::Status::ERROR;
}
if (!MoveDir(context_->unpacked_dir_path.get(), install_path)) {
- LOG(ERROR) << "Cannot move widget directory to install path";
+ LOG(ERROR) << "Cannot move widget directory to install path, from "
+ << context_->unpacked_dir_path.get() << " to " << install_path;
return Status::ERROR;
}
LOG(INFO) << "Successfully move: " << context_->unpacked_dir_path.get()
"Directory for manifest xml is missing and cannot be created";
return Status::ERROR;
}
-
- if (!common_installer::SetDirPermissions(xml_path.parent_path(),
- bf::owner_all | bf::group_read | bf::others_read)) {
- LOG(ERROR) <<
- "Could not set permissions for dir:" << xml_path.parent_path();
- return Status::ERROR;
- }
}
xmlTextWriterPtr writer;
return Step::Status::ERROR;
}
- if (!SetDirPermissions(tmp_dir,
- bf::owner_all | bf::group_read | bf::others_read)) {
- LOG(ERROR) <<
- "Could not set permissions for dir:" << tmp_dir;
- return Status::ERROR;
- }
-
int64_t required_size =
GetUnpackedPackageSize(context_->file_path.get());
LOG(ERROR) << "Unable to create destination directory" << dst.string();
return false;
}
-
- if (!SetDirPermissions(dst,
- bf::owner_all | bf::group_read | bf::others_read)) {
- LOG(ERROR) <<
- "Could not set permissions for dir:" << dst;
- return false;
- }
} catch (const bf::filesystem_error& error) {
LOG(ERROR) << "Failed to copy directory: " << error.what();
return false;
}
bool MoveDir(const bf::path& src, const bf::path& dst) {
- if (bf::exists(dst))
+ if (bf::exists(dst)) {
+ LOG(ERROR) << "Destination directory does not exist: " << dst;
return false;
+ }
+
bs::error_code error;
bf::rename(src, dst, error);
if (error) {
<< filename_in_zip_path.parent_path();
return false;
}
- if (!SetDirPermissions(
- filename_in_zip_path.parent_path(),
- bf::owner_all | bf::group_read | bf::others_read)) {
- LOG(ERROR) <<
- "Could not set permissions for dir:" <<
- filename_in_zip_path.parent_path();
- return false;
- }
}
if (!zip_file.OpenCurrent()) {
LOG(ERROR) << "Directory creation failure: " << bindir;
return false;
}
- if (!common_installer::SetDirPermissions(bindir,
- bf::owner_all | bf::group_read | bf::others_read)) {
- LOG(ERROR) <<
- "Could not set permissions for dir:" << bindir;
- return false;
- }
// Exec path
// Make a symlink with the name of appid, pointing exec file
/ bf::path("bin");
common_installer::CreateDir(exec_path);
- common_installer::SetDirPermissions(exec_path,
- bf::owner_all | bf::group_read | bf::others_read);
-
exec_path /= bf::path(app->appid);
if (strcmp(app->component_type, "uiapp") == 0) {
LOG(ERROR) << "unable to create dir for temp backup data";
return false;
}
- if (!cu::SetDirPermissions(temp_install_path,
- bf::owner_all | bf::group_read | bf::others_read)) {
- LOG(ERROR) <<
- "Could not set permissions for dir:" << temp_install_path;
- return false;
- }
-
-
} else {
if (!bf::exists(temp_install_path.parent_path()) &&
!cu::CreateDir(temp_install_path.parent_path())) {
LOG(ERROR) << "unable to create dir for temp backup data";
return false;
}
- if (!cu::SetDirPermissions(temp_install_path.parent_path(),
- bf::owner_all | bf::group_read | bf::others_read)) {
- LOG(ERROR) <<
- "Could not set permissions for dir:"
- << temp_install_path.parent_path();
- return false;
- }
-
-
bf::path temp_unzip_path(unzip_path / file);
bf::copy_file(temp_unzip_path, temp_install_path, error);
if (error) {
return false;
}
- if (!cu::SetDirPermissions(backup_temp_dir_,
- bf::owner_all | bf::group_read | bf::others_read)) {
- LOG(ERROR) <<
- "Could not set permissions for dir:"
- << backup_temp_dir_;
- return false;
- }
-
return true;
}
LOG(ERROR) << "unable to create dir for temp backup data";
return false;
}
- if (!cu::SetDirPermissions(backup_temp_dir_ / relative_path,
- bf::owner_all | bf::group_read | bf::others_read)) {
- LOG(ERROR)
- << "Could not set permissions for dir:"
- << (backup_temp_dir_ / relative_path).string();
- return false;
- }
-
} else {
bs::error_code error;
bf::path tmp_dest_path = backup_temp_dir_ / relative_path;
LOG(ERROR) << "unable to create dir for temp backup data";
return false;
}
-
- if (!cu::SetDirPermissions((tmp_dest_path).parent_path(),
- bf::owner_all | bf::group_read | bf::others_read)) {
- LOG(ERROR) << "Could not set permissions for dir:"
- << (tmp_dest_path).parent_path();
- return false;
- }
-
bf::copy_file(source_path, tmp_dest_path, error);
if (error) {
LOG(ERROR) << "unable to backup file: "
} else {
if (bf::is_directory(source_path)) {
cu::CreateDir(destination_path);
- cu::SetDirPermissions(destination_path,
- bf::owner_all | bf::group_read | bf::others_read);
} else {
bf::copy_file(source_path, destination_path,
bf::copy_option::overwrite_if_exists);