From 7ebb8bade3a31f3da4276709bce7c27deeecfbf5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 7 Jun 2019 19:47:09 +0200 Subject: [PATCH] Add current and new version for apps in tools_update output --- src/yunohost/tools.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index 23fc50483..acde7a8d5 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -534,9 +534,21 @@ def _list_upgradable_apps(): app_dict = app_info(app_id, raw=True) if app_dict["upgradable"] == "yes": + + current_version = app_dict.get("version", "?") + current_commit = app_dict.get("status", {}).get("remote", {}).get("revision", "?")[:7] + new_version = app_dict.get("manifest",{}).get("version","?") + new_commit = app_dict.get("git", {}).get("revision", "?")[:7] + + if current_version == new_version: + current_version += " (" + current_commit + ")" + new_version += " (" + new_commit + ")" + yield { 'id': app_id, - 'label': app_dict['settings']['label'] + 'label': app_dict['settings']['label'], + 'current_version': current_version, + 'new_version': new_version }