Skip to content

Commit f6bad91

Browse files
committed
update clang checking
1 parent a7bdc12 commit f6bad91

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

mytonctrl/mytonctrl.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,6 @@ def Update(local, args):
345345
#end define
346346

347347
def Upgrade(ton, args):
348-
force = False
349-
if '--force' in args:
350-
force = True
351-
args.remove('--force')
352-
353348
repo = "ton"
354349
author, repo, branch = check_git(args, repo, "upgrade")
355350

@@ -372,13 +367,15 @@ def Upgrade(ton, args):
372367
ton.SetSettings("validatorConsole", validatorConsole)
373368

374369
clang_version = get_clang_major_version()
375-
if (clang_version is None or clang_version < 16) and not force:
376-
text = "{red}Error: clang version 16 or higher is required for TON Node software upgrade.{endc}\n"
370+
if clang_version is None or clang_version < 16:
371+
text = "{yellow}Warning: clang version 16 or higher is required for TON Node software upgrade.{endc}\n"
377372
if clang_version is None:
378373
text += "Could not check clang version.\n If you are sure that clang version is 16 or higher, use --force option.\n"
379-
text += "For clang update check the following instructions: https://gist.github.com/neodix42/e4b1b68d2d5dd3dec75b5221657f05d7"
374+
text += "For clang update check the following instructions: https://gist.github.com/neodix42/e4b1b68d2d5dd3dec75b5221657f05d7\n"
380375
color_print(text)
381-
return
376+
if input("Continue with upgrade anyway? [Y/n]\n").strip().lower() not in ('y', ''):
377+
print('aborted.')
378+
return
382379

383380
# Run script
384381
upgrade_script_path = pkg_resources.resource_filename('mytonctrl', 'scripts/upgrade.sh')
@@ -417,7 +414,8 @@ def get_clang_major_version():
417414
return None
418415

419416
return int(major_version)
420-
except Exception:
417+
except Exception as e:
418+
print(f"Error checking clang version: {type(e)}: {e}")
421419
return None
422420

423421
def rollback_to_mtc1(local, ton, args):

0 commit comments

Comments
 (0)