diff options
Diffstat (limited to 'build_files/utils/make_utils.py')
-rwxr-xr-x | build_files/utils/make_utils.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/build_files/utils/make_utils.py b/build_files/utils/make_utils.py index 98536879b91..d05c1e6f838 100755 --- a/build_files/utils/make_utils.py +++ b/build_files/utils/make_utils.py @@ -2,6 +2,7 @@ # # Utility functions for make update and make tests. +import re import subprocess import sys @@ -15,3 +16,24 @@ def call(cmd): retcode = subprocess.call(cmd) if retcode != 0: sys.exit(retcode) + +def git_branch_release_version(git_command): + # Test if we are building a specific release version. + try: + branch = subprocess.check_output([git_command, "rev-parse", "--abbrev-ref", "HEAD"]) + except subprocess.CalledProcessError as e: + sys.stderr.write("Failed to get Blender git branch\n") + sys.exit(1) + + branch = branch.strip().decode('utf8') + release_version = re.search("^blender-v(.*)-release$", branch) + if release_version: + release_version = release_version.group(1) + return release_version + +def svn_libraries_base_url(release_version): + if release_version: + svn_branch = "tags/blender-" + release_version + "-release" + else: + svn_branch = "trunk" + return "https://svn.blender.org/svnroot/bf-blender/" + svn_branch + "/lib/" |