bullseye->bookworm: try the yunohost upgrade without unholding the app-ynh-deps virtual packages, then after unholding if it didnt work for some reason

This commit is contained in:
Alexandre Aubin 2024-07-17 15:24:04 +02:00
parent a5868733d7
commit a8fd6afeee

View file

@ -216,10 +216,19 @@ class MyMigration(Migration):
# Yunohost upgrade
#
logger.info(m18n.n("migration_0027_yunohost_upgrade"))
aptitude_with_progress_bar(f"unhold yunohost moulinette ssowat yunohost-admin {' '.join(apps_packages)}")
aptitude_with_progress_bar("full-upgrade --show-why yunohost yunohost-admin yunohost-portal moulinette ssowat python3.9- python3.9-venv- -o Dpkg::Options::='--force-confold'")
try:
aptitude_with_progress_bar("full-upgrade --show-why yunohost yunohost-admin yunohost-portal moulinette ssowat python3.9- python3.9-venv- -o Dpkg::Options::='--force-confold'")
except Exception as e:
# Retry after unholding the app packages, maybe it can unlock the situation idk
if apps_packages:
aptitude_with_progress_bar(f"unhold {' '.join(apps_packages)}")
aptitude_with_progress_bar("full-upgrade --show-why yunohost yunohost-admin yunohost-portal moulinette ssowat python3.9- python3.9-venv- -o Dpkg::Options::='--force-confold'")
else:
# If the upgrade was sucessful, we want to unhold the apps packages
if apps_packages:
aptitude_with_progress_bar(f"unhold {' '.join(apps_packages)}")
# If running from the webadmin, restart the API after a delay
if Moulinette.interface.type == "api":