From 53cd445785c795caba9c2fbc5fa2756e02d6fe70 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 20 Aug 2019 09:45:18 +0200 Subject: Build: support updating for release branches in make_update.py --- build_files/utils/make_update.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'build_files/utils') diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py index d737c3772b7..b4125e0aeec 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -16,9 +16,27 @@ def print_stage(text): print(text) print("") +# Test if we are building a specific release version +try: + branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]) +except subprocess.CalledProcessError as e: + sys.stderr("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) + print("Using Release Blender v" + release_version) + # Setup for precompiled libraries and tests from svn lib_dirpath = os.path.join('..', 'lib') -svn_url = "https://svn.blender.org/svnroot/bf-blender/trunk/lib/" + +if release_version: + svn_branch = "tags/blender-" + release_version + "-release" +else: + svn_branch = "trunk" +svn_url = "https://svn.blender.org/svnroot/bf-blender/" + svn_branch + "/lib/" # Checkout precompiled libraries if sys.platform == 'darwin': @@ -56,6 +74,7 @@ if os.path.isdir(lib_dirpath): if os.path.isdir(dirpath) and \ (os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath)): call(["svn", "cleanup", dirpath]) + call(["svn", "switch", svn_url + dirname, dirpath]) call(["svn", "update", dirpath]) # Update blender repository and submodules @@ -63,5 +82,10 @@ print_stage("Updating Blender Git Repository and Submodules") call(["git", "pull", "--rebase"]) call(["git", "submodule", "update", "--init", "--recursive"]) -call(["git", "submodule", "foreach", "git", "checkout", "master"]) -call(["git", "submodule", "foreach", "git", "pull", "--rebase", "origin", "master"]) + +if not release_version: + # Update submodules to latest master if not building a specific release. + # In that case submodules are set to a specific revision, which is checked + # out by running "git submodule update". + call(["git", "submodule", "foreach", "git", "checkout", "master"]) + call(["git", "submodule", "foreach", "git", "pull", "--rebase", "origin", "master"]) -- cgit v1.2.3