step/step_convert_xml.cc
step/step_tpk_patch_icons.cc
step/step_manifest_adjustment.cc
+ step/step_check_pkg_directory_path.cc
tpk_app_query_interface.cc
tpk_installer.cc
)
--- /dev/null
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "tpk/step/step_check_pkg_directory_path.h"
+
+#include <boost/filesystem.hpp>
+#include <string>
+
+namespace tpk {
+namespace filesystem {
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+
+common_installer::Step::Status StepCheckPkgDirPath::process() {
+ if (!bf::exists(context_->pkg_path.get())) {
+ LOG(INFO) << "Create pkg_path("
+ << context_->pkg_path.get()
+ << ") for package("
+ << context_->pkgid.get() << ")";
+ bs::error_code error;
+ bf::create_directories(context_->pkg_path.get(), error);
+ if (error) {
+ LOG(ERROR) << "Cannot create directory: "
+ << context_->pkg_path.get().string();
+ return Step::Status::APP_DIR_ERROR;
+ }
+ }
+
+ return Status::OK;
+}
+
+} // namespace filesystem
+} // namespace tpk
--- /dev/null
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef TPK_STEP_STEP_CHECK_PKG_DIRECTORY_PATH_H_
+#define TPK_STEP_STEP_CHECK_PKG_DIRECTORY_PATH_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include "common/installer_context.h"
+#include "common/step/step.h"
+
+namespace tpk {
+namespace filesystem {
+
+class StepCheckPkgDirPath : public common_installer::Step {
+ public:
+ using Step::Step;
+
+ Status process() override;
+ Status clean() override { return Status::OK; }
+ Status undo() override { return Status::OK; }
+ Status precheck() override { return Status::OK; }
+
+ SCOPE_LOG_TAG(CheckPkgDirPath)
+};
+
+} // namespace filesystem
+} // namespace tpk
+
+#endif // TPK_STEP_STEP_CHECK_PKG_DIRECTORY_PATH_H_
#include "tpk/step/step_parse_preload.h"
#include "tpk/step/step_convert_xml.h"
#include "tpk/step/step_tpk_patch_icons.h"
+#include "tpk/step/step_check_pkg_directory_path.h"
namespace ci = common_installer;
void TpkInstaller::ManifestDirectInstallSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+ AddStep<tpk::filesystem::StepCheckPkgDirPath>();
AddStep<ci::parse::StepParseManifest>(
ci::parse::StepParseManifest::ManifestLocation::INSTALLED,
ci::parse::StepParseManifest::StoreLocation::NORMAL);