From a99bb920dcf5107650923ce39ecc7c423df00e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80?= <78488229+viktor138irk@users.noreply.github.com> Date: Thu, 7 May 2026 01:51:40 +0900 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=BA=D0=BB=D1=8E=D1=87?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20=D0=B2?= =?UTF-8?q?=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20?= =?UTF-8?q?=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20=D1=83=D1=81=D1=82=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D1=89=D0=B8=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/patch_update_center.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/patch_update_center.py b/scripts/patch_update_center.py index 9532148..6c202a0 100644 --- a/scripts/patch_update_center.py +++ b/scripts/patch_update_center.py @@ -1,11 +1,27 @@ #!/usr/bin/env python3 from pathlib import Path +import runpy import sys app_path = Path(sys.argv[1]) if len(sys.argv) > 1 else Path('/opt/virtuality/web/app.py') if not app_path.exists(): raise SystemExit(f'app.py not found: {app_path}') +script_dir = Path(__file__).resolve().parent + +# New installs run this patch from install_web_panel.sh. Keep feature patches here too +# so a fresh install gets disk images, VM architecture selector and update center +# without requiring extra manual commands. +for optional_patch in ('patch_disk_images.py', 'patch_vm_architecture.py'): + patch_path = script_dir / optional_patch + if patch_path.exists(): + old_argv = sys.argv[:] + try: + sys.argv = [str(patch_path), str(app_path)] + runpy.run_path(str(patch_path), run_name='__main__') + finally: + sys.argv = old_argv + text = app_path.read_text() changed = []