mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Improve yunohost package version diagnosis
This commit is contained in:
parent
f8db099487
commit
08c23599e2
3 changed files with 11 additions and 4 deletions
|
@ -37,16 +37,20 @@ class BaseSystemDiagnoser(Diagnoser):
|
||||||
# Here, ynh_core_version is for example "3.5.4.12", so [:3] is "3.5" and we check it's the same for all packages
|
# Here, ynh_core_version is for example "3.5.4.12", so [:3] is "3.5" and we check it's the same for all packages
|
||||||
ynh_core_version = ynh_packages["yunohost"]["version"]
|
ynh_core_version = ynh_packages["yunohost"]["version"]
|
||||||
consistent_versions = all(infos["version"][:3] == ynh_core_version[:3] for infos in ynh_packages.values())
|
consistent_versions = all(infos["version"][:3] == ynh_core_version[:3] for infos in ynh_packages.values())
|
||||||
ynh_version_details = [("diagnosis_basesystem_ynh_single_version", (package, infos["version"]))
|
ynh_version_details = [("diagnosis_basesystem_ynh_single_version", (package, infos["version"], infos["repo"]))
|
||||||
for package, infos in ynh_packages.items()]
|
for package, infos in ynh_packages.items()]
|
||||||
|
|
||||||
if consistent_versions:
|
if consistent_versions:
|
||||||
yield dict(meta={"test": "ynh_versions"},
|
yield dict(meta={"test": "ynh_versions"},
|
||||||
|
data={"main_version": ynh_core_version, "repo": ynh_packages["yunohost"]["repo"]},
|
||||||
status="INFO",
|
status="INFO",
|
||||||
summary=("diagnosis_basesystem_ynh_main_version", {"main_version": ynh_core_version[:3]}),
|
summary=("diagnosis_basesystem_ynh_main_version",
|
||||||
|
{"main_version": ynh_core_version,
|
||||||
|
"repo": ynh_packages["yunohost"]["repo"]}),
|
||||||
details=ynh_version_details)
|
details=ynh_version_details)
|
||||||
else:
|
else:
|
||||||
yield dict(meta={"test": "ynh_versions"},
|
yield dict(meta={"test": "ynh_versions"},
|
||||||
|
data={"main_version": ynh_core_version, "repo": ynh_packages["yunohost"]["repo"]},
|
||||||
status="ERROR",
|
status="ERROR",
|
||||||
summary=("diagnosis_basesystem_ynh_inconsistent_versions", {}),
|
summary=("diagnosis_basesystem_ynh_inconsistent_versions", {}),
|
||||||
details=ynh_version_details)
|
details=ynh_version_details)
|
||||||
|
|
|
@ -152,8 +152,8 @@
|
||||||
"custom_appslist_name_required": "You must provide a name for your custom app list",
|
"custom_appslist_name_required": "You must provide a name for your custom app list",
|
||||||
"diagnosis_basesystem_host": "Server is running Debian {debian_version}.",
|
"diagnosis_basesystem_host": "Server is running Debian {debian_version}.",
|
||||||
"diagnosis_basesystem_kernel": "Server is running Linux kernel {kernel_version}",
|
"diagnosis_basesystem_kernel": "Server is running Linux kernel {kernel_version}",
|
||||||
"diagnosis_basesystem_ynh_single_version": "{0} version: {1}",
|
"diagnosis_basesystem_ynh_single_version": "{0} version: {1} ({2})",
|
||||||
"diagnosis_basesystem_ynh_main_version": "Server is running YunoHost {main_version}",
|
"diagnosis_basesystem_ynh_main_version": "Server is running YunoHost {main_version} ({repo})",
|
||||||
"diagnosis_basesystem_ynh_inconsistent_versions": "You are running inconsistents versions of the YunoHost packages ... most probably because of a failed or partial upgrade.",
|
"diagnosis_basesystem_ynh_inconsistent_versions": "You are running inconsistents versions of the YunoHost packages ... most probably because of a failed or partial upgrade.",
|
||||||
"diagnosis_display_tip_web": "You can go to the Diagnosis section (in the home screen) to see the issues found.",
|
"diagnosis_display_tip_web": "You can go to the Diagnosis section (in the home screen) to see the issues found.",
|
||||||
"diagnosis_display_tip_cli": "You can run 'yunohost diagnosis show --issues' to display the issues found.",
|
"diagnosis_display_tip_cli": "You can run 'yunohost diagnosis show --issues' to display the issues found.",
|
||||||
|
|
|
@ -406,6 +406,9 @@ def get_installed_version(*pkgnames, **kwargs):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
repo = ""
|
repo = ""
|
||||||
|
|
||||||
|
if repo == "now":
|
||||||
|
repo = "local"
|
||||||
|
|
||||||
if with_repo:
|
if with_repo:
|
||||||
versions[pkgname] = {
|
versions[pkgname] = {
|
||||||
"version": version,
|
"version": version,
|
||||||
|
|
Loading…
Add table
Reference in a new issue