mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Improve version management in catalog
This commit is contained in:
parent
1826e3c5b6
commit
c34de0b792
1 changed files with 7 additions and 3 deletions
|
@ -162,9 +162,13 @@ def _app_upgradable(app_infos):
|
||||||
# In case there is neither update_time nor install_time, we assume the app can/has to be upgraded
|
# In case there is neither update_time nor install_time, we assume the app can/has to be upgraded
|
||||||
|
|
||||||
# Firstly use the version to know if an upgrade is available
|
# Firstly use the version to know if an upgrade is available
|
||||||
if app_infos["manifest"].get('integration', {}).get("upgrade_only_if_version_changes", None) is True and \
|
app_is_in_catalog = bool(app_infos.get("from_catalog"))
|
||||||
'~ynh' in app_infos["version"] and app_infos["from_catalog"]["manifest"].get("version", None):
|
upgrade_only_if_version_changes = app_infos["manifest"].get('integration', {}).get("upgrade_only_if_version_changes", None) is True
|
||||||
if version.parse(app_infos["version"]) < version.parse(app_infos["from_catalog"]["manifest"].get("version", "-")):
|
installed_version = version.parse(app_infos["version"])
|
||||||
|
version_in_catalog = version.parse(app_infos.get("from_catalog", {}).get("manifest", {}).get("version", "0~ynh0"))
|
||||||
|
|
||||||
|
if app_is_in_catalog and '~ynh' in app_infos["version"]:
|
||||||
|
if upgrade_only_if_version_changes and installed_version < version_in_catalog:
|
||||||
return "yes"
|
return "yes"
|
||||||
else:
|
else:
|
||||||
return "no"
|
return "no"
|
||||||
|
|
Loading…
Add table
Reference in a new issue