[Issue#] N/A
[Problem] unremoved installed directory and manifest file when installation failed.
[Cause] There aren't abort logic after ace check filed.
[Solution] Add abrot logic for remove
[SCMRequest] N/A
{
LogDebug("[Rename Widget Path] Aborting.... (Rename path)");
std::string widgetPath;
{
LogDebug("[Rename Widget Path] Aborting.... (Rename path)");
std::string widgetPath;
- if (m_context.widgetConfig.packagingType == PKG_TYPE_HYBRID_WEB_APP) {
+ if (m_context.widgetConfig.packagingType != PKG_TYPE_HYBRID_WEB_APP) {
widgetPath = m_context.locations->getPackageInstallationDir();
widgetPath = m_context.locations->getPackageInstallationDir();
- } else {
- widgetPath = m_context.locations->getSourceDir();
- }
- struct stat fileInfo;
- if (stat(widgetPath.c_str(), &fileInfo) != 0) {
- LogError("Failed to get widget file path : " << widgetPath);
- return;
- }
-
- if (!(rename(widgetPath.c_str(), m_context.locations->getTemporaryPackageDir().c_str()) == 0)) {
- LogError("Failed to rename");
+ if (!WrtUtilRemove(widgetPath)) {
+ ThrowMsg(Exceptions::RemovingFolderFailure,
+ "Error occurs during removing existing folder");
+ }
}
LogDebug("Rename widget path sucessful!");
}
}
LogDebug("Rename widget path sucessful!");
}
AddStep(&TaskManifestFile::stepGenerateManifest);
AddStep(&TaskManifestFile::stepParseManifest);
AddStep(&TaskManifestFile::stepFinalize);
AddStep(&TaskManifestFile::stepGenerateManifest);
AddStep(&TaskManifestFile::stepParseManifest);
AddStep(&TaskManifestFile::stepFinalize);
+
+ AddAbortStep(&TaskManifestFile::stepAbortParseManifest);
} else {
// for widget update.
AddStep(&TaskManifestFile::stepBackupIconFiles);
} else {
// for widget update.
AddStep(&TaskManifestFile::stepBackupIconFiles);
+void TaskManifestFile::stepAbortParseManifest()
+{
+ LogError("[Parse Manifest] Abroting....");
+
+ int code = pkgmgr_parser_parse_manifest_for_uninstallation(
+ DPL::ToUTF8String(manifest_file).c_str(), NULL);
+
+ if (0 != code)
+ {
+ LogWarning("Manifest parser error: " << code);
+ ThrowMsg(ManifestParsingError, "Parser returncode: " << code);
+ }
+ int ret = unlink(DPL::ToUTF8String(manifest_file).c_str());
+ if (0 != ret)
+ {
+ LogWarning("No manifest file found: " << manifest_file);
+ }
+
+}
+
} //namespace WidgetInstall
} //namespace Jobs
} //namespace WidgetInstall
} //namespace Jobs
void stepParseManifest();
void stepParseUpgradedManifest();
void stepParseManifest();
void stepParseUpgradedManifest();
+ void stepAbortParseManifest();
+
//For widget update
void stepBackupIconFiles();
void stepUpdateFinalize();
//For widget update
void stepBackupIconFiles();
void stepUpdateFinalize();