Change duplicated step name 30/218830/2
authorJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 28 Nov 2019 11:10:18 +0000 (20:10 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 9 Dec 2019 00:10:11 +0000 (00:10 +0000)
Same step name exists on wgt-backend.

Change-Id: Iea12e8def08dd21e91302a602c82c1eb91881c97
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/tpk/step/filesystem/step_create_symbolic_link.cc [deleted file]
src/tpk/step/filesystem/step_create_symbolic_link.h [deleted file]
src/tpk/step/filesystem/step_create_tpk_symbolic_link.cc [new file with mode: 0644]
src/tpk/step/filesystem/step_create_tpk_symbolic_link.h [new file with mode: 0644]
src/tpk/tpk_installer.cc

diff --git a/src/tpk/step/filesystem/step_create_symbolic_link.cc b/src/tpk/step/filesystem/step_create_symbolic_link.cc
deleted file mode 100644 (file)
index 8afacd0..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Copyright 2015 Samsung Electronics, license APACHE-2.0, see LICENSE file */
-
-#include "tpk/step/filesystem/step_create_symbolic_link.h"
-
-#include <boost/filesystem.hpp>
-#include <boost/system/error_code.hpp>
-
-#include <common/app_installer.h>
-#include <common/step/step.h>
-#include <common/installer_context.h>
-#include <common/utils/file_util.h>
-#include <common/utils/glist_range.h>
-
-#include <pkgmgr-info.h>
-
-#include <iostream>
-
-namespace tpk {
-namespace filesystem {
-
-namespace bf = boost::filesystem;
-namespace ci = common_installer;
-
-using common_installer::InstallerContext;
-typedef common_installer::Step::Status Status;
-
-bool CreateSymLink(application_x* app, InstallerContext* context) {
-  boost::system::error_code boost_error;
-  bf::path bindir = context->GetPkgPath() /
-      bf::path("bin");
-  LOG(DEBUG) << "Creating dir: " << bindir;
-  if (!bf::is_symlink(symlink_status(bindir)) &&
-      !common_installer::CreateDir(bindir)) {
-    LOG(ERROR) << "Directory creation failure: " << bindir;
-    return false;
-  }
-
-  if (app->ui_gadget && strcmp(app->ui_gadget, "true") == 0) {
-    // Ug-client path
-    // Make a symlink with the name of appid, pointing /usr/bin/ug-client
-    bf::path app_exec_path(app->exec);
-    if (!bf::exists(app_exec_path)) {
-      bf::path ug_client_path(tzplatform_mkpath(TZ_SYS_BIN, "ug-client"));
-      LOG(INFO) << "Createing symlink " << app_exec_path << " pointing " <<
-        ug_client_path;
-      bf::create_symlink(ug_client_path, app_exec_path, boost_error);
-      if (boost_error) {
-        LOG(ERROR) << "Symlink creation failure: " << app_exec_path;
-        return false;
-      }
-    }
-  }
-
-  return true;
-}
-
-Status StepCreateSymbolicLink::precheck() {
-  manifest_x *m = context_->manifest_data.get();
-  if (!m) {
-    LOG(ERROR) << "manifest_data attribute is empty";
-    return Step::Status::INVALID_VALUE;
-  }
-  if (!m->application) {
-    LOG(ERROR) << "No application exists";
-    return Step::Status::ERROR;
-  }
-
-  return Step::Status::OK;
-}
-
-Status StepCreateSymbolicLink::process() {
-  manifest_x* m = context_->manifest_data.get();
-  for (application_x* app : GListRange<application_x*>(m->application)) {
-    // filter out non-tpk apps as this step is run for hybrid backend too
-    if (strcmp("webapp", app->type) == 0)
-      continue;
-    if (!CreateSymLink(app, context_))
-      return Status::ERROR;
-  }
-  return Status::OK;
-}
-
-}  // namespace filesystem
-}  // namespace tpk
diff --git a/src/tpk/step/filesystem/step_create_symbolic_link.h b/src/tpk/step/filesystem/step_create_symbolic_link.h
deleted file mode 100644 (file)
index e27eea2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright 2015 Samsung Electronics, license APACHE-2.0, see LICENSE file */
-
-#ifndef TPK_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
-#define TPK_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
-
-#include <manifest_parser/utils/logging.h>
-
-#include <common/app_installer.h>
-
-namespace tpk {
-namespace filesystem {
-
-class StepCreateSymbolicLink : 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;
-
-  STEP_NAME(CreateSymbolicLink)
-};
-
-}  // namespace filesystem
-}  // namespace tpk
-
-#endif  // TPK_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
diff --git a/src/tpk/step/filesystem/step_create_tpk_symbolic_link.cc b/src/tpk/step/filesystem/step_create_tpk_symbolic_link.cc
new file mode 100644 (file)
index 0000000..29f2158
--- /dev/null
@@ -0,0 +1,84 @@
+/* Copyright 2015 Samsung Electronics, license APACHE-2.0, see LICENSE file */
+
+#include "tpk/step/filesystem/step_create_tpk_symbolic_link.h"
+
+#include <boost/filesystem.hpp>
+#include <boost/system/error_code.hpp>
+
+#include <common/app_installer.h>
+#include <common/step/step.h>
+#include <common/installer_context.h>
+#include <common/utils/file_util.h>
+#include <common/utils/glist_range.h>
+
+#include <pkgmgr-info.h>
+
+#include <iostream>
+
+namespace tpk {
+namespace filesystem {
+
+namespace bf = boost::filesystem;
+namespace ci = common_installer;
+
+using common_installer::InstallerContext;
+typedef common_installer::Step::Status Status;
+
+bool CreateSymLink(application_x* app, InstallerContext* context) {
+  boost::system::error_code boost_error;
+  bf::path bindir = context->GetPkgPath() /
+      bf::path("bin");
+  LOG(DEBUG) << "Creating dir: " << bindir;
+  if (!bf::is_symlink(symlink_status(bindir)) &&
+      !common_installer::CreateDir(bindir)) {
+    LOG(ERROR) << "Directory creation failure: " << bindir;
+    return false;
+  }
+
+  if (app->ui_gadget && strcmp(app->ui_gadget, "true") == 0) {
+    // Ug-client path
+    // Make a symlink with the name of appid, pointing /usr/bin/ug-client
+    bf::path app_exec_path(app->exec);
+    if (!bf::exists(app_exec_path)) {
+      bf::path ug_client_path(tzplatform_mkpath(TZ_SYS_BIN, "ug-client"));
+      LOG(INFO) << "Createing symlink " << app_exec_path << " pointing " <<
+        ug_client_path;
+      bf::create_symlink(ug_client_path, app_exec_path, boost_error);
+      if (boost_error) {
+        LOG(ERROR) << "Symlink creation failure: " << app_exec_path;
+        return false;
+      }
+    }
+  }
+
+  return true;
+}
+
+Status StepCreateTpkSymbolicLink::precheck() {
+  manifest_x *m = context_->manifest_data.get();
+  if (!m) {
+    LOG(ERROR) << "manifest_data attribute is empty";
+    return Step::Status::INVALID_VALUE;
+  }
+  if (!m->application) {
+    LOG(ERROR) << "No application exists";
+    return Step::Status::ERROR;
+  }
+
+  return Step::Status::OK;
+}
+
+Status StepCreateTpkSymbolicLink::process() {
+  manifest_x* m = context_->manifest_data.get();
+  for (application_x* app : GListRange<application_x*>(m->application)) {
+    // filter out non-tpk apps as this step is run for hybrid backend too
+    if (strcmp("webapp", app->type) == 0)
+      continue;
+    if (!CreateSymLink(app, context_))
+      return Status::ERROR;
+  }
+  return Status::OK;
+}
+
+}  // namespace filesystem
+}  // namespace tpk
diff --git a/src/tpk/step/filesystem/step_create_tpk_symbolic_link.h b/src/tpk/step/filesystem/step_create_tpk_symbolic_link.h
new file mode 100644 (file)
index 0000000..63cc4f6
--- /dev/null
@@ -0,0 +1,27 @@
+/* Copyright 2015 Samsung Electronics, license APACHE-2.0, see LICENSE file */
+
+#ifndef TPK_STEP_FILESYSTEM_STEP_CREATE_TPK_SYMBOLIC_LINK_H_
+#define TPK_STEP_FILESYSTEM_STEP_CREATE_TPK_SYMBOLIC_LINK_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include <common/app_installer.h>
+
+namespace tpk {
+namespace filesystem {
+
+class StepCreateTpkSymbolicLink : 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;
+
+  STEP_NAME(CreateTpkSymbolicLink)
+};
+
+}  // namespace filesystem
+}  // namespace tpk
+
+#endif  // TPK_STEP_FILESYSTEM_STEP_CREATE_TPK_SYMBOLIC_LINK_H_
index a1310885f2807f63b3b2d5122dd4d6293f73fff6..3994b7cbb436efb6f15abb58aff07311115dd637 100644 (file)
@@ -89,7 +89,7 @@
 #include "tpk/step/configuration/step_adjust_install_location.h"
 #include "tpk/step/configuration/step_check_reinstall_manifest.h"
 #include "tpk/step/filesystem/step_create_external_storage_directories.h"
-#include "tpk/step/filesystem/step_create_symbolic_link.h"
+#include "tpk/step/filesystem/step_create_tpk_symbolic_link.h"
 #include "tpk/step/filesystem/step_check_pkg_directory_path.h"
 #include "tpk/step/filesystem/step_remove_external_storage_directories.h"
 #include "tpk/step/filesystem/step_tpk_patch_icons.h"
@@ -142,7 +142,7 @@ void TpkInstaller::InstallSteps() {
   AddStep<ci::filesystem::StepCopy>();
   AddStep<ci::filesystem::StepCopyTep>();
   AddStep<tpk::filesystem::StepCreateExternalStorageDirectories>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::filesystem::StepCreateIcons>();
   AddStep<tpk::pkgmgr::StepConvertXml>();
@@ -191,7 +191,7 @@ void TpkInstaller::UpdateSteps() {
   AddStep<ci::filesystem::StepUpdateTep>();
   AddStep<ci::filesystem::StepCopyStorageDirectories>();
   AddStep<tpk::filesystem::StepUpdateExternalStorageDirectories>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::filesystem::StepCreateIcons>();
   AddStep<tpk::pkgmgr::StepConvertXml>();
@@ -265,7 +265,7 @@ void TpkInstaller::ReinstallSteps() {
   AddStep<ci::rds::StepRDSParse>();
   AddStep<ci::rds::StepRDSModify>();
   AddStep<ci::filesystem::StepUpdateTep>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::filesystem::StepCreateIcons>();
   AddStep<tpk::filesystem::StepUpdateExternalStorageDirectories>();
@@ -316,7 +316,7 @@ void TpkInstaller::DeltaSteps() {
   AddStep<ci::filesystem::StepUpdateTep>();
   AddStep<ci::filesystem::StepCopyStorageDirectories>();
   AddStep<tpk::filesystem::StepUpdateExternalStorageDirectories>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::filesystem::StepCreateIcons>();
   AddStep<tpk::pkgmgr::StepConvertXml>();
@@ -392,7 +392,7 @@ void TpkInstaller::MountInstallSteps() {
   AddStep<tpk::filesystem::StepTpkPreparePackageDirectory>();
   AddStep<ci::filesystem::StepCopyTep>();
   AddStep<tpk::filesystem::StepCreateExternalStorageDirectories>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::filesystem::StepCreateIcons>();
   AddStep<tpk::pkgmgr::StepConvertXml>();
@@ -439,7 +439,7 @@ void TpkInstaller::MountUpdateSteps() {
   AddStep<ci::mount::StepMountUpdate>();
   AddStep<tpk::filesystem::StepTpkPreparePackageDirectory>();
   AddStep<ci::filesystem::StepUpdateTep>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<tpk::filesystem::StepUpdateExternalStorageDirectories>();
   AddStep<ci::filesystem::StepCreateIcons>();
@@ -475,7 +475,7 @@ void TpkInstaller::ManifestDirectInstallSteps() {
   AddStep<ci::security::StepPrivilegeCompatibility>(
       ci::security::StepPrivilegeCompatibility::InternalPrivType::TPK);
   AddStep<tpk::security::StepCheckTpkBackgroundCategory>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::security::StepRollbackInstallationSecurity>();
   AddStep<ci::pkgmgr::StepRegisterApplication>();
@@ -507,7 +507,7 @@ void TpkInstaller::ManifestDirectUpdateSteps() {
   AddStep<ci::security::StepPrivilegeCompatibility>(
       ci::security::StepPrivilegeCompatibility::InternalPrivType::TPK);
   AddStep<tpk::security::StepCheckTpkBackgroundCategory>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<ci::pkgmgr::StepKillApps>();
   AddStep<ci::security::StepRollbackInstallationSecurity>();
@@ -616,7 +616,7 @@ void TpkInstaller::ReadonlyUpdateInstallSteps() {
   AddStep<ci::filesystem::StepCopyTep>();
   AddStep<ci::filesystem::StepCreateStorageDirectories>();
   AddStep<tpk::filesystem::StepCreateExternalStorageDirectories>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<tpk::filesystem::StepTpkPatchIcons>();
   AddStep<tpk::pkgmgr::StepConvertXml>();
   AddStep<tpk::pkgmgr::StepManifestAdjustment>();