feature #4215: Update marketapps from external marketplaces when MD5 or

VERSION changes
This commit is contained in:
Ruben S. Montero committed 2016-03-18 12:37:17 +01:00
1 parent 875f0362c0
commit 0799819c84
2 files changed
+11 -1

No files matched your search

+2
View File
@@ -423,6 +423,8 @@ int MarketPlaceApp::from_template64(const std::string &info64, std::string& err)
char * error_msg;
obj_template->clear();
int rc = obj_template->parse(*info, &error_msg);
delete info;
+9 -1
View File
@@ -234,10 +234,18 @@ int MarketPlaceAppPool::import(const std::string& t64, int mp_id,
}
}
MarketPlaceApp * mp_aux = get(app->name, 0, false);
MarketPlaceApp * mp_aux = get(app->name, 0, true);
if( mp_aux != 0 ) //Marketplace app already imported
{
if ( mp_aux->version != app->version || mp_aux->md5 != app->version )
{
mp_aux->from_template64(t64, error_str);
update(mp_aux);
}
mp_aux->unlock();
delete app;
return -2;
}