From 7860a9d80e1442fae7891580cdfeb404dd938b2a Mon Sep 17 00:00:00 2001 From: Damian Pietruchowski Date: Tue, 4 Apr 2017 11:55:59 +0200 Subject: [PATCH] Unnecessary queries if pkg_id is empty Change-Id: I825867e85142e704a50ecde510c4a8b72d97ae84 Signed-off-by: Damian Pietruchowski --- src/wgt/step/configuration/step_parse.cc | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/wgt/step/configuration/step_parse.cc b/src/wgt/step/configuration/step_parse.cc index 6157663..1844dec 100644 --- a/src/wgt/step/configuration/step_parse.cc +++ b/src/wgt/step/configuration/step_parse.cc @@ -273,19 +273,24 @@ bool StepParse::FillWidgetInfo(manifest_x* manifest) { manifest->installlocation = strdup("auto"); } - // set update true if package is updated preload package - ci::RequestType req_type = context_->request_type.get(); - if (ci::QueryIsUpdatedPackage(context_->pkgid.get(), context_->uid.get())) - manifest->update = strdup("true"); - else if (ci::QueryIsPreloadPackage(context_->pkgid.get(), - context_->uid.get()) && - (req_type == ci::RequestType::Update || - req_type == ci::RequestType::Delta || - req_type == ci::RequestType::MountUpdate || - req_type == ci::RequestType::ReadonlyUpdateInstall)) - manifest->update = strdup("true"); - else + if (!context_->pkgid.get().empty()) { + // set update true if package is updated preload package + ci::RequestType req_type = context_->request_type.get(); + if (ci::QueryIsUpdatedPackage(context_->pkgid.get(), context_->uid.get())) + manifest->update = strdup("true"); + else if (ci::QueryIsPreloadPackage(context_->pkgid.get(), + context_->uid.get()) && + (req_type == ci::RequestType::Update || + req_type == ci::RequestType::Delta || + req_type == ci::RequestType::MountUpdate || + req_type == ci::RequestType::ReadonlyUpdateInstall)) + manifest->update = strdup("true"); + else + manifest->update = strdup("false"); + } + else { manifest->update = strdup("false"); + } return true; } -- 2.7.4