Remove unused parameter and related codes 29/90929/2
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 5 Oct 2016 04:29:39 +0000 (13:29 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 5 Oct 2016 05:18:18 +0000 (22:18 -0700)
Related change:
[pkgmgr-info] https://review.tizen.org/gerrit/#/c/90930/

Change-Id: I515923cc827535e8c42d4dadadf7149a87b98224
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/common/pkgmgr_registration.cc
src/common/pkgmgr_registration.h
src/common/step/pkgmgr/step_recover_application.cc
src/common/step/pkgmgr/step_register_app.cc
src/common/step/pkgmgr/step_register_app.h
src/common/step/pkgmgr/step_unregister_app.cc
src/common/step/pkgmgr/step_update_app.cc
src/common/step/pkgmgr/step_update_app.h

index 410fa6f..e2e45eb 100644 (file)
@@ -159,7 +159,6 @@ bool AssignPackageTags(manifest_x* manifest,
 namespace common_installer {
 
 bool RegisterAppInPkgmgr(manifest_x* manifest,
-                         const bf::path& xml_path,
                          const std::string& pkgid,
                          const CertificateInfo& cert_info,
                          uid_t uid,
@@ -173,10 +172,8 @@ bool RegisterAppInPkgmgr(manifest_x* manifest,
     return false;
 
   int ret = request_mode != RequestMode::GLOBAL ?
-      pkgmgr_parser_process_usr_manifest_x_for_installation(manifest,
-          xml_path.c_str(), uid) :
-      pkgmgr_parser_process_manifest_x_for_installation(manifest,
-          xml_path.c_str());
+      pkgmgr_parser_process_usr_manifest_x_for_installation(manifest, uid) :
+      pkgmgr_parser_process_manifest_x_for_installation(manifest);
   if (ret) {
     LOG(ERROR) << "Failed to insert manifest into pkgmgr, error code=" << ret;
     return false;
@@ -191,7 +188,6 @@ bool RegisterAppInPkgmgr(manifest_x* manifest,
 }
 
 bool UpgradeAppInPkgmgr(manifest_x* manifest,
-                        const bf::path& xml_path,
                         const std::string& pkgid,
                         const CertificateInfo& cert_info,
                         uid_t uid,
@@ -200,9 +196,8 @@ bool UpgradeAppInPkgmgr(manifest_x* manifest,
     return false;
 
   int ret = request_mode != RequestMode::GLOBAL ?
-       pkgmgr_parser_process_usr_manifest_x_for_upgrade(manifest,
-          xml_path.c_str(), uid) :
-       pkgmgr_parser_process_manifest_x_for_upgrade(manifest, xml_path.c_str());
+       pkgmgr_parser_process_usr_manifest_x_for_upgrade(manifest, uid) :
+       pkgmgr_parser_process_manifest_x_for_upgrade(manifest);
 
   if (ret != 0) {
     LOG(ERROR) << "Failed to update manifest in pkgmgr, error code=" << ret;
@@ -217,15 +212,12 @@ bool UpgradeAppInPkgmgr(manifest_x* manifest,
 }
 
 bool UnregisterAppInPkgmgr(manifest_x* manifest,
-                           const bf::path& xml_path,
                            const std::string& pkgid,
                            uid_t uid,
                            RequestMode request_mode) {
   int ret = request_mode != RequestMode::GLOBAL ?
-      pkgmgr_parser_process_usr_manifest_x_for_uninstallation(manifest,
-          xml_path.c_str(), uid) :
-      pkgmgr_parser_process_manifest_x_for_uninstallation(manifest,
-          xml_path.c_str());
+      pkgmgr_parser_process_usr_manifest_x_for_uninstallation(manifest, uid) :
+      pkgmgr_parser_process_manifest_x_for_uninstallation(manifest);
   if (ret) {
     LOG(ERROR) << "Failed to delete manifest from pkgmgr, error code=" << ret;
     return false;
index 70d71b1..7c9c995 100644 (file)
@@ -19,7 +19,7 @@ namespace common_installer {
  * \brief Adapter interface for external PkgMgr module used for registering
  *        package into pkgmgr
  *
- * \param xml_path path to generated xml
+ * \param manifest parsed manifest information
  * \param pkgid package pkgid
  * \param uid user id
  * \param request_mode current request mode
@@ -27,7 +27,6 @@ namespace common_installer {
  * \return true if success
  */
 bool RegisterAppInPkgmgr(manifest_x* manifest,
-                         const boost::filesystem::path& xml_path,
                          const std::string& pkgid,
                          const CertificateInfo& cert_info,
                          uid_t uid,
@@ -39,7 +38,7 @@ bool RegisterAppInPkgmgr(manifest_x* manifest,
  * \brief Adapter interface for external PkgMgr module used for upgrading
  *        package within pkgmgr
  *
- * \param xml_path path to generated xml
+ * \param manifest parsed manifest information
  * \param pkgid package pkgid
  * \param cert_info certifciate info
  * \param uid user id
@@ -48,7 +47,6 @@ bool RegisterAppInPkgmgr(manifest_x* manifest,
  * \return true if success
  */
 bool UpgradeAppInPkgmgr(manifest_x* manifest,
-                        const boost::filesystem::path& xml_path,
                         const std::string& pkgid,
                         const CertificateInfo& cert_info,
                         uid_t uid,
@@ -58,7 +56,7 @@ bool UpgradeAppInPkgmgr(manifest_x* manifest,
  * \brief Adapter interface for external PkgMgr module used for deregistering
  *        package into pkgmgr
  *
- * \param xml_path path to generated xml
+ * \param manifest parsed manifest information
  * \param pkgid package pkgid
  * \param uid user id
  * \param request_mode current request mode
@@ -66,7 +64,6 @@ bool UpgradeAppInPkgmgr(manifest_x* manifest,
  * \return true if success
  */
 bool UnregisterAppInPkgmgr(manifest_x* manifest,
-                           const boost::filesystem::path& xml_path,
                            const std::string& pkgid,
                            uid_t uid,
                            RequestMode request_mode);
index 4d6cab7..586a18b 100644 (file)
@@ -18,7 +18,6 @@ Step::Status StepRecoverApplication::RecoveryNew() {
   if (!SetXmlPaths())
     return Status::OK;
   UnregisterAppInPkgmgr(context_->manifest_data.get(),
-                        context_->xml_path.get(),
                         context_->pkgid.get(),
                         context_->uid.get(),
                         context_->request_mode.get());
@@ -30,15 +29,11 @@ Step::Status StepRecoverApplication::RecoveryUpdate() {
     LOG(ERROR) << "Some parameters are lacking";
     return Status::ERROR;
   }
-  bf::path xml_path = bf::exists(context_->backup_xml_path.get()) ?
-        context_->backup_xml_path.get() : context_->xml_path.get();
   UnregisterAppInPkgmgr(context_->manifest_data.get(),
-                        xml_path,
                         context_->pkgid.get(),
                         context_->uid.get(),
                         context_->request_mode.get());
   if (!RegisterAppInPkgmgr(context_->manifest_data.get(),
-                           xml_path,
                            context_->pkgid.get(),
                            context_->certificate_info.get(),
                            context_->uid.get(),
index f6c491d..3d95193 100644 (file)
 namespace common_installer {
 namespace pkgmgr {
 
-Step::Status StepRegisterApplication::precheck() {
-  if (context_->xml_path.get().empty()) {
-    LOG(ERROR) << "xml_path attribute is empty";
-    return Step::Status::MANIFEST_NOT_FOUND;
-  }
-  if (!boost::filesystem::exists(context_->xml_path.get())) {
-    LOG(ERROR) << "xml_path ("
-               << context_->xml_path.get()
-               << ") path does not exist";
-    return Step::Status::MANIFEST_NOT_FOUND;
-  }
-
-  return Step::Status::OK;
-}
-
 Step::Status StepRegisterApplication::process() {
   if (!RegisterAppInPkgmgr(context_->manifest_data.get(),
-                           context_->xml_path.get(),
                            context_->pkgid.get(),
                            context_->certificate_info.get(),
                            context_->uid.get(),
@@ -47,7 +31,6 @@ Step::Status StepRegisterApplication::process() {
 
 Step::Status StepRegisterApplication::undo() {
   if (!UnregisterAppInPkgmgr(context_->manifest_data.get(),
-                             context_->xml_path.get(),
                              context_->pkgid.get(),
                              context_->uid.get(),
                              context_->request_mode.get())) {
index 965a410..bebf9f5 100644 (file)
@@ -18,7 +18,7 @@ class StepRegisterApplication : public Step {
   Status process() override;
   Status clean() override { return Status::OK; }
   Status undo() override;
-  Status precheck() override;
+  Status precheck() override { return Status::OK; }
 
   STEP_NAME(RegisterApp)
 };
index 6f2150c..3313e18 100644 (file)
@@ -71,7 +71,6 @@ Step::Status StepUnregisterApplication::process() {
   }
 
   if (!UnregisterAppInPkgmgr(context_->manifest_data.get(),
-                             context_->xml_path.get(),
                              context_->pkgid.get(),
                              context_->uid.get(),
                              context_->request_mode.get())) {
@@ -89,7 +88,6 @@ Step::Status StepUnregisterApplication::process() {
 
 Step::Status StepUnregisterApplication::undo() {
   if (!RegisterAppInPkgmgr(context_->manifest_data.get(),
-                           context_->backup_xml_path.get(),
                            context_->pkgid.get(),
                            context_->certificate_info.get(),
                            context_->uid.get(),
index 540dc8b..af90d09 100644 (file)
@@ -25,17 +25,8 @@ namespace bf = boost::filesystem;
 namespace common_installer {
 namespace pkgmgr {
 
-Step::Status StepUpdateApplication::precheck() {
-  if (context_->xml_path.get().empty()) {
-    LOG(ERROR) << "Xml path is empty";
-    return Status::MANIFEST_NOT_FOUND;
-  }
-  return Status::OK;
-}
-
 Step::Status StepUpdateApplication::process() {
   if (!UpgradeAppInPkgmgr(context_->manifest_data.get(),
-                          context_->xml_path.get(),
                           context_->pkgid.get(),
                           context_->certificate_info.get(),
                           context_->uid.get(),
@@ -67,7 +58,6 @@ Step::Status StepUpdateApplication::undo() {
   }
 
   if (!UpgradeAppInPkgmgr(context_->old_manifest_data.get(),
-                          context_->backup_xml_path.get(),
                           context_->pkgid.get(), certificate_info,
                           context_->uid.get(),
                           context_->request_mode.get())) {
index c9008d3..b607f53 100644 (file)
@@ -20,7 +20,7 @@ class StepUpdateApplication : public Step {
   Status process() override;
   Status clean() override { return Status::OK; }
   Status undo() override;
-  Status precheck() override;
+  Status precheck() override { return Status::OK; }
 
   STEP_NAME(UpdateApplication)
 };