Basic implementation of StepParseRpkManifest
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 10 May 2021 08:07:54 +0000 (17:07 +0900)
committer연정현/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <jungh.yeon@samsung.com>
Wed, 12 May 2021 07:12:49 +0000 (16:12 +0900)
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/rpk/step/configuration/step_parse_rpk_manifest.cc [new file with mode: 0644]
src/rpk/step/configuration/step_parse_rpk_manifest.h [new file with mode: 0644]

diff --git a/src/rpk/step/configuration/step_parse_rpk_manifest.cc b/src/rpk/step/configuration/step_parse_rpk_manifest.cc
new file mode 100644 (file)
index 0000000..c33946e
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "step/configuration/step_parse_rpk_manifest.h"
+
+#include <common/installer_context.h>
+#include <common/step/step.h>
+
+namespace rpk {
+namespace configuration {
+
+StepParseRpkManifest::StepParseRpkManifest(
+    common_installer::InstallerContext* context,
+    ManifestLocation manifest_location,
+    StoreLocation store_location)
+    : Step(context),
+      manifest_location_(manifest_location),
+      store_location_(store_location) {
+}
+
+common_installer::Step::Status StepParseRpkManifest::precheck() {
+  return common_installer::Step::Status::OK;
+}
+
+common_installer::Step::Status StepParseRpkManifest::process() {
+  return common_installer::Step::Status::OK;
+}
+
+}  // namespace configuration
+}  // namespace rpk
diff --git a/src/rpk/step/configuration/step_parse_rpk_manifest.h b/src/rpk/step/configuration/step_parse_rpk_manifest.h
new file mode 100644 (file)
index 0000000..61c5fba
--- /dev/null
@@ -0,0 +1,56 @@
+// Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef RPK_STEP_CONFIGURATION_STEP_PARSE_RPK_MANIFEST_H_
+#define RPK_STEP_CONFIGURATION_STEP_PARSE_RPK_MANIFEST_H_
+
+#include <boost/filesystem.hpp>
+
+#include <common/installer/app_installer.h>
+#include <common/installer_context.h>
+#include <common/step/step.h>
+
+#include <manifest_parser/utils/logging.h>
+#include <rpk_manifest_handlers/rpk_config_parser.h>
+
+#include <memory>
+#include <set>
+#include <string>
+
+namespace rpk {
+namespace configuration {
+
+class StepParseRpkManifest : public common_installer::Step {
+ public:
+  enum class ManifestLocation {
+    PACKAGE,    // parse manifest file from unpacking diretory
+    INSTALLED,  // parse manfiest file from current package installation
+    RECOVERY    // parse manifest file from backup location or package location
+  };
+
+  enum class StoreLocation {
+    NORMAL,  // store in context as current application information (new)
+    BACKUP   // store in context as old version application information (update)
+  };
+
+  explicit StepParseRpkManifest(common_installer::InstallerContext* context,
+      ManifestLocation manifest_location, StoreLocation store_location);
+
+  Status process() override;
+  Status clean() override { return Status::OK; }
+  Status undo() override { return Status::OK; }
+  Status precheck() override;
+
+ private:
+
+  ManifestLocation manifest_location_;
+  StoreLocation store_location_;
+
+  STEP_NAME(ParseRpkManifest)
+};
+
+}  // namespace configuration
+}  // namespace rpk
+
+#endif  // RPK_STEP_CONFIGURATION_STEP_PARSE_RPK_MANIFEST_H_