1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
5 #include "hybrid/step/configuration/step_merge_tpk_config.h"
7 #include <pkgmgrinfo_basic.h>
9 #include "hybrid/hybrid_backend_data.h"
12 namespace configuration {
14 StepMergeTpkConfig::StepMergeTpkConfig(
15 common_installer::InstallerContext* context,
16 MergeType type) : Step(context), merge_type_(type) {
19 common_installer::Step::Status StepMergeTpkConfig::process() {
20 HybridBackendData* data =
21 static_cast<HybridBackendData*>(context_->backend_data.get());
22 manifest_x* tpk_data = data->tpk_manifest_data.get();
23 manifest_x* wgt_data = context_->manifest_data.get();
25 if (merge_type_ == MergeType::CONCAT)
26 wgt_data->application =
27 g_list_concat(wgt_data->application, tpk_data->application);
29 wgt_data->application = tpk_data->application;
31 tpk_data->application = nullptr;
35 } // namespace configuration