}
bool JobWidgetInstall::setTizenId(
- const WrtDB::ConfigParserData &configInfo, ConfigureResult result,
+ const WrtDB::ConfigParserData &configInfo,
+ const WidgetUpdateInfo &update,
bool preload)
{
+ using namespace PackageManager;
regex_t reg;
if(regcomp(®, REG_TIZENID_PATTERN, REG_NOSUB | REG_EXTENDED)!=0){
LogDebug("Regcomp failed");
}
- struct stat dirStat;
-
+ ConfigureResult result = checkWidgetUpdate(update);
if(!!configInfo.tizenId) {
LogDebug("Setting tizenId provided in config.xml: " << configInfo.tizenId);
+ // send start signal of pkgmgr
+ PkgmgrSignalSingleton::Instance().setPkgname(
+ DPL::ToUTF8String(*(configInfo.tizenId)));
+ PkgmgrSignalSingleton::Instance().sendSignal(
+ PKGMGR_START_KEY,
+ PKGMGR_START_INSTALL);
+
+ if (result == ConfigureResult::Failed) {
+ return false;
+ }
+
if ((regexec(®, DPL::ToUTF8String(*(configInfo.tizenId)).c_str(),
static_cast<size_t>(0), NULL, 0) != REG_NOERROR) ||
(checkTizenIdExist(DPL::ToUTF8String(*(configInfo.tizenId))) &&
m_installerContext.widgetConfig.pkgname = tizenId;
}
LogInfo("tizen_id name was generated by WRT: " << tizenId);
+ // send start signal of pkgmgr
+ PkgmgrSignalSingleton::Instance().setPkgname(DPL::ToUTF8String(
+ *m_installerContext.widgetConfig.pkgname));
+ PkgmgrSignalSingleton::Instance().sendSignal(
+ PKGMGR_START_KEY,
+ PKGMGR_START_INSTALL);
}
regfree(®);
const WidgetUpdateInfo &update,
const std::string &tempPath)
{
+
+ if (!setTizenId(configData, update, m_jobStruct.m_preload)) {
+ return ConfigureResult::Failed;
+ } else {
+ LogInfo("Tizen Id: " << m_installerContext.widgetConfig.pkgname);
+
+ configureWidgetLocation(widgetSource, tempPath);
+ }
+
+ // Init installer context
+ m_installerContext.installStep = InstallerContext::INSTALL_START;
+ m_installerContext.job = this;
+ m_installerContext.existingWidgetInfo = update.existingWidgetInfo;
+ m_installerContext.widgetConfig.shareHref = std::string();
+
+ return ConfigureResult::Ok;
+}
+
+JobWidgetInstall::ConfigureResult JobWidgetInstall::checkWidgetUpdate(
+ const WidgetUpdateInfo &update)
+{
LogInfo(
"Widget install/update: incoming guid = '" <<
update.incomingGUID << "'");
// Check policy
WidgetUpdateMode::Type updateTypeCheckBit;
- JobWidgetInstall::ConfigureResult ret = ConfigureResult::Ok;
if (update.existingWidgetInfo.isExist == false) {
LogInfo("Widget info does not exist");
} else {
LogInfo(
"Widget is already running. Policy is not update according to WAC");
- LogInfo("Installation aborted: " << widgetSource);
return ConfigureResult::Failed;
}
WidgetUpdateMode::PolicyDirectoryForceInstall)
{
LogInfo("Whether widget policy allow proceed ok");
- ret = ConfigureResult::Updated;
+ return ConfigureResult::Updated;
}
else
return ConfigureResult::Failed;
}
-
- if (!setTizenId(configData, ret, m_jobStruct.m_preload)) {
- return ConfigureResult::Failed;
- } else {
- using namespace PackageManager;
- LogInfo("Tizen Id: " << m_installerContext.widgetConfig.pkgname);
-
- configureWidgetLocation(widgetSource, tempPath);
-
- // send start signal of pkgmgr
- PkgmgrSignalSingleton::Instance().setPkgname(
- DPL::ToUTF8String(
- *m_installerContext.widgetConfig.pkgname));
- PkgmgrSignalSingleton::Instance().sendSignal(
- PKGMGR_START_KEY,
- PKGMGR_START_INSTALL);
- }
-
- // Init installer context
- m_installerContext.installStep = InstallerContext::INSTALL_START;
- m_installerContext.job = this;
- m_installerContext.existingWidgetInfo = update.existingWidgetInfo;
- m_installerContext.widgetConfig.shareHref = std::string();
-
- // Return result
- return ret;
+ return ConfigureResult::Ok;
}
WidgetUpdateMode::Type JobWidgetInstall::CalcWidgetUpdatePolicy(