donate_cpu: master branch was renamed to main

This commit is contained in:
Daniel Marjamäki 2020-06-15 19:46:34 +02:00
parent f5fe5ca2dd
commit e2c99ee697
1 changed files with 8 additions and 3 deletions

View File

@ -15,7 +15,7 @@ import shlex
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
# changes)
CLIENT_VERSION = "1.2.4"
CLIENT_VERSION = "1.3.1"
# Timeout for analysis with Cppcheck in seconds
CPPCHECK_TIMEOUT = 60 * 60
@ -41,8 +41,13 @@ def get_cppcheck(cppcheck_path, work_path):
if os.path.exists(cppcheck_path):
try:
os.chdir(cppcheck_path)
try:
subprocess.check_call(['git', 'checkout', '-f', 'main'])
except CalledProcessError:
subprocess.check_call(['git', 'checkout', '-f', 'master'])
subprocess.check_call(['git', 'pull'])
subprocess.check_call(['git', 'checkout', 'origin/main', '-b', 'main'])
subprocess.check_call(['git', 'pull'])
except:
print('Failed to update Cppcheck sources! Retrying..')
time.sleep(10)
@ -88,7 +93,7 @@ def compile_version(work_path, jobs, version):
destPath = work_path + '/' + version + '/'
subprocess.call(['cp', '-R', work_path + '/cppcheck/cfg', destPath])
subprocess.call(['cp', 'cppcheck', destPath])
subprocess.call(['git', 'checkout', 'master'])
subprocess.call(['git', 'checkout', 'main'])
try:
subprocess.call([work_path + '/' + version + '/cppcheck', '--version'])
except OSError: