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/ # 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 # Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
# changes) # changes)
CLIENT_VERSION = "1.2.4" CLIENT_VERSION = "1.3.1"
# Timeout for analysis with Cppcheck in seconds # Timeout for analysis with Cppcheck in seconds
CPPCHECK_TIMEOUT = 60 * 60 CPPCHECK_TIMEOUT = 60 * 60
@ -41,7 +41,12 @@ def get_cppcheck(cppcheck_path, work_path):
if os.path.exists(cppcheck_path): if os.path.exists(cppcheck_path):
try: try:
os.chdir(cppcheck_path) os.chdir(cppcheck_path)
subprocess.check_call(['git', 'checkout', '-f', 'master']) 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']) subprocess.check_call(['git', 'pull'])
except: except:
print('Failed to update Cppcheck sources! Retrying..') print('Failed to update Cppcheck sources! Retrying..')
@ -88,7 +93,7 @@ def compile_version(work_path, jobs, version):
destPath = work_path + '/' + version + '/' destPath = work_path + '/' + version + '/'
subprocess.call(['cp', '-R', work_path + '/cppcheck/cfg', destPath]) subprocess.call(['cp', '-R', work_path + '/cppcheck/cfg', destPath])
subprocess.call(['cp', 'cppcheck', destPath]) subprocess.call(['cp', 'cppcheck', destPath])
subprocess.call(['git', 'checkout', 'master']) subprocess.call(['git', 'checkout', 'main'])
try: try:
subprocess.call([work_path + '/' + version + '/cppcheck', '--version']) subprocess.call([work_path + '/' + version + '/cppcheck', '--version'])
except OSError: except OSError: