return {};
}
+bool IsTpkApp(application_x* app) {
+ return strcmp(app->type, "capp") == 0 || strcmp(app->type, "jsapp") == 0;
+}
+
} // namespace
namespace tpk {
bf::create_directories(common_icon_location, error);
for (application_x* app :
GListRange<application_x*>(context_->manifest_data.get()->application)) {
- if (strcmp(app->type, "capp") != 0 && strcmp(app->type, "jsapp") != 0)
+ if (!IsTpkApp(app))
continue;
if (app->icon) {
icon_x* icon = reinterpret_cast<icon_x*>(app->icon->data);
#include <common/step/step_configure.h>
#include <common/step/step_backup_icons.h>
#include <common/step/step_backup_manifest.h>
+#include <common/step/step_clear_data.h>
#include <common/step/step_create_icons.h>
#include <common/step/step_create_storage_directories.h>
#include <common/step/step_copy.h>
case ci::RequestType::ManifestDirectUpdate:
ManifestDirectUpdateSteps();
break;
+ case ci::RequestType::Clear:
+ ClearSteps();
+ break;
default:
AddStep<ci::configuration::StepFail>();
break;
AddStep<ci::pkgmgr::StepUpdateApplication>();
}
+void TpkInstaller::ClearSteps() {
+ AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+ AddStep<ci::filesystem::StepClearData>();
+}
+
} // namespace tpk