From 8140adf848fbe4dfb4f8fe4cf43f828921a14a2c Mon Sep 17 00:00:00 2001 From: firewave Date: Mon, 23 Oct 2023 10:33:06 +0200 Subject: [PATCH] donate-cpu.py: avoid unnecessary `git checkout` invocation if non-`main` binary already exists --- tools/donate-cpu.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/donate-cpu.py b/tools/donate-cpu.py index 9cefaa4679b..142622b1212 100755 --- a/tools/donate-cpu.py +++ b/tools/donate-cpu.py @@ -182,6 +182,9 @@ if ver == 'head': ver = 'main' current_cppcheck_dir = os.path.join(work_path, 'tree-'+ver) + if ver != 'main' and lib.has_binary(current_cppcheck_dir): + print('No need to check Cppcheck-{} for changes - binary already exists'.format(ver)) + continue print('Checking Cppcheck-{} for changes..'.format(ver)) try: has_changes = lib.try_retry(lib.checkout_cppcheck_version, fargs=(repo_path, ver, current_cppcheck_dir), max_tries=3, sleep_duration=30.0, sleep_factor=1.0)