From 9e1b0561e3f6a88bd822382d33887878d56d609b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 26 Jul 2024 20:10:28 +0200 Subject: [PATCH] bullseye->bookworm: readd tweak about libluajit2 + be more robust about full-upgrade that may fail if python3.9-venv aint installed --- .../0027_migrate_to_bookworm.py.disabled | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/migrations/0027_migrate_to_bookworm.py.disabled b/src/migrations/0027_migrate_to_bookworm.py.disabled index a33e1e7ba..5395153cc 100644 --- a/src/migrations/0027_migrate_to_bookworm.py.disabled +++ b/src/migrations/0027_migrate_to_bookworm.py.disabled @@ -220,13 +220,23 @@ class MyMigration(Migration): logger.info(m18n.n("migration_0027_yunohost_upgrade")) aptitude_with_progress_bar("unhold yunohost moulinette ssowat yunohost-admin") + + full_upgrade_cmd = "full-upgrade --show-why -o Dpkg::Options::='--force-confold' " + full_upgrade_cmd += "yunohost yunohost-admin yunohost-portal moulinette ssowat " + # This one is needed to solve aptitude derping with nginx dependencies + full_upgrade_cmd += "libluajit2-5.1-2 " + if os.system('dpkg --list | grep -q "^ii python3.9-venv "') == 0: + full_upgrade_cmd += "python3.9- " + if os.system('dpkg --list | grep -q "^ii python3.9 "') == 0: + full_upgrade_cmd += "python3.9-venv- " + 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'") + aptitude_with_progress_bar(full_upgrade_cmd) except Exception: # 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'") + aptitude_with_progress_bar(full_upgrade_cmd) else: # If the upgrade was sucessful, we want to unhold the apps packages if apps_packages: