Check dpkg status asap in app_install

This commit is contained in:
Alexandre Aubin 2019-02-22 15:06:11 +01:00
parent c824f10cc2
commit dcf2ca8b55

View file

@ -708,6 +708,9 @@ def app_install(operation_logger, auth, app, label=None, args=None, no_remove_on
no_remove_on_failure -- Debug option to avoid removing the app on a failed installation no_remove_on_failure -- Debug option to avoid removing the app on a failed installation
force -- Do not ask for confirmation when installing experimental / low-quality apps force -- Do not ask for confirmation when installing experimental / low-quality apps
""" """
if packages.dpkg_is_broken():
raise YunohostError(m18n.n("dpkg_is_broken"))
from yunohost.hook import hook_add, hook_remove, hook_exec, hook_callback from yunohost.hook import hook_add, hook_remove, hook_exec, hook_callback
from yunohost.log import OperationLogger from yunohost.log import OperationLogger
@ -725,9 +728,6 @@ def app_install(operation_logger, auth, app, label=None, args=None, no_remove_on
}, },
} }
if packages.dpkg_is_broken():
raise YunohostError(m18n.n("dpkg_is_broken"))
def confirm_install(confirm): def confirm_install(confirm):
# Ignore if there's nothing for confirm (good quality app), if --force is used # Ignore if there's nothing for confirm (good quality app), if --force is used