From ca1e73b788ce1ac2107dd4d3d6e6d4bc0a4e937b Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Sun, 10 May 2026 14:24:48 +0200 Subject: [PATCH] more aggressive updating --- system/updated/updated.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/system/updated/updated.py b/system/updated/updated.py index 517f6d61d..c6508fb21 100755 --- a/system/updated/updated.py +++ b/system/updated/updated.py @@ -386,6 +386,16 @@ class Updater: git_fetch_output = run(fetch_cmd, OVERLAY_MERGED) cloudlog.info("git fetch success: %s", git_fetch_output) + if force: + cloudlog.info("force download: tearing down current submodule state before checkout") + pre_checkout_cmds = [ + ["git", "submodule", "sync", "--recursive"], + ["git", "submodule", "deinit", "--force", "--all"], + ["git", "clean", "-xdff"], + ] + pre_checkout_results = [run(cmd, OVERLAY_MERGED) for cmd in pre_checkout_cmds] + cloudlog.info("force download pre-checkout success: %s", '\n'.join(pre_checkout_results)) + cloudlog.info("git reset in progress") cmds = [ ["git", "checkout", "--force", "--no-recurse-submodules", "-B", branch, "FETCH_HEAD"], @@ -396,11 +406,12 @@ class Updater: if force: cmds += [ ["git", "submodule", "sync", "--recursive"], - ["git", "submodule", "deinit", "--force", "--all"], - ["git", "clean", "-xdff"], + ["git", "submodule", "update", "--init", "--force", "--recursive"], + ["git", "submodule", "sync", "--recursive"], ["git", "submodule", "update", "--init", "--force", "--recursive"], ["git", "submodule", "foreach", "--recursive", "git", "reset", "--hard"], ["git", "submodule", "foreach", "--recursive", "git", "clean", "-xdff"], + ["git", "submodule", "update", "--init", "--force", "--recursive"], ] else: cmds += [