From 4152cb0dd1d76107cf1322e34db2ecbe6abc3923 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 10 Jul 2023 17:34:21 +0200 Subject: [PATCH] apps: fix a bug where YunoHost would complain that 'it needs X RAM but only Y left' with Y > X because some apps have a higher runtime RAM requirement than build time ... --- src/app.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app.py b/src/app.py index a90e273a2..cce0aa51c 100644 --- a/src/app.py +++ b/src/app.py @@ -2782,10 +2782,18 @@ def _check_manifest_requirements( ram_requirement["runtime"] ) + # Some apps have a higher runtime value than build ... + if ram_requirement["build"] != "?" and ram_requirement["runtime"] != "?": + max_build_runtime = (ram_requirement["build"] + if human_to_binary(ram_requirement["build"]) > human_to_binary(ram_requirement["runtime"]) + else ram_requirement["runtime"]) + else: + max_build_runtime = ram_requirement["build"] + yield ( "ram", can_build and can_run, - {"current": binary_to_human(ram), "required": ram_requirement["build"]}, + {"current": binary_to_human(ram), "required": max_build_runtime}, "app_not_enough_ram", # i18n: app_not_enough_ram )