From: Soyoung Kim Date: Mon, 6 May 2013 11:04:30 +0000 (+0900) Subject: Remove check upper version when update. X-Git-Tag: submit/tizen_2.2/20130716.180435~1^2~156^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d7065f41b19a71d16b9b1be5cc1bfed6cb95e5a8;p=framework%2Fweb%2Fwrt-installer.git Remove check upper version when update. [Issue#] N/A [Problem] N/A [Cause] N/A [Solution] wrt-installer should not check version when web app update. To check upversion should be on store. So web app can update if incomming version is lower then existing version. [SCMRequest] N/A Change-Id: I65ef04b27b77adb13c7e516664f58c985a9b9b4f --- diff --git a/src/jobs/widget_install/job_widget_install.cpp b/src/jobs/widget_install/job_widget_install.cpp index cc011ed..aa46a4e 100644 --- a/src/jobs/widget_install/job_widget_install.cpp +++ b/src/jobs/widget_install/job_widget_install.cpp @@ -555,13 +555,14 @@ bool JobWidgetInstall::validateTizenPackageID( ConfigureResult JobWidgetInstall::checkWidgetUpdate( const WidgetUpdateInfo &update) { - LogInfo("incoming version = '" << update.incomingVersion); - LogInfo("Tizen AppID = " << update.tzAppId); - if (update.existingVersion.IsNull() || update.incomingVersion.IsNull()) { return ConfigureResult::Failed; } + LogInfo("existing version = '" << update.existingVersion); + LogInfo("incoming version = '" << update.incomingVersion); + LogInfo("Tizen AppID = " << update.tzAppId); + // Check running state bool isRunning = false; int ret = @@ -622,46 +623,15 @@ ConfigureResult JobWidgetInstall::checkWidgetUpdate( m_installerContext.widgetConfig.tzAppid = update.tzAppId; - if (isUpperVersion(update.existingVersion, update.incomingVersion) || - m_installerContext.mode.extension == InstallMode::ExtensionType::DIR) - { - LogInfo("Whether widget policy allow proceed ok"); + if (!!update.existingVersion || + m_installerContext.mode.extension == + InstallMode::ExtensionType::DIR) { return ConfigureResult::Updated; - } else { - return ConfigureResult::Failed_LowerVersion; } return ConfigureResult::Failed; } -bool JobWidgetInstall::isUpperVersion( - const OptionalWidgetVersion &existingVersion, - const OptionalWidgetVersion &incomingVersion) -{ - LogInfo("Existing version = '" << *existingVersion); - LogInfo("Incoming version = '" << *incomingVersion); - - if (!existingVersion && !incomingVersion) { - return false; - } else if (!existingVersion && !!incomingVersion) { - return false; - } else if (!!existingVersion && !incomingVersion) { - return true; - } else { - if (!existingVersion->IsWac() || !incomingVersion->IsWac()) { - return false; - } else { - if (*incomingVersion == *existingVersion) { - return false; - } else if (*incomingVersion > *existingVersion) { - return true; - } else { - return false; - } - } - } -} - ConfigParserData JobWidgetInstall::getWidgetDataFromXML( const std::string &widgetSource, const std::string &tempPath, diff --git a/src/jobs/widget_install/job_widget_install.h b/src/jobs/widget_install/job_widget_install.h index f0af6f2..549c80d 100644 --- a/src/jobs/widget_install/job_widget_install.h +++ b/src/jobs/widget_install/job_widget_install.h @@ -79,9 +79,6 @@ class JobWidgetInstall : static WidgetUpdateInfo detectWidgetUpdate( const WrtDB::ConfigParserData &configInfo, const WrtDB::TizenAppId &tizenId); - bool isUpperVersion( - const OptionalWidgetVersion &existingVersion, - const OptionalWidgetVersion &incomingVersion); void setTizenId(const WrtDB::ConfigParserData &configInfo); void displayWidgetInfo(); void configureWidgetLocation(const std::string & widgetPath,