From 0503a38a74ccc39ba298423c2d1c09fa187b756b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 31 Jul 2024 00:06:33 +0200 Subject: [PATCH] bullseye->bookworm: add a trick to flag the migration as done if it's still marked as pending --- src/tools.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tools.py b/src/tools.py index ec90361fc..5ec556012 100644 --- a/src/tools.py +++ b/src/tools.py @@ -671,6 +671,15 @@ def tools_migrations_run( raise YunohostValidationError("migrations_no_such_migration", id=target) + # Dirty hack to mark the bullseye->bookworm as done ... + # it may still be marked as 'pending' if for some reason the migration crashed, + # but the admins ran 'apt full-upgrade' to manually finish the migration + # ... in which case it won't be magically flagged as 'done' until here + migrate_to_bookworm = get_matching_migration("migrate_to_bookworm") + if migrate_to_bookworm.state == "pending": + migrate_to_bookworm.state = "done" + _write_migration_state(migrate_to_bookworm.id, "done") + # auto, skip and force are exclusive options if auto + skip + force_rerun > 1: raise YunohostValidationError("migrations_exclusive_options")