Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-08-20 13:05:03 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-08-30 18:57:18 +0300
commit018fe9e006a87daa26c4f3f49220f43884cf32df (patch)
treecc121d172c02fe3d887066aed5f76ce3e9c05892 /build_files/utils
parent410cde82e352d5f4f3588a6e179a22779a7dd3ab (diff)
Build: move "make update" on macOS and Linux to Python script
Differential Revision: https://developer.blender.org/D5545
Diffstat (limited to 'build_files/utils')
-rwxr-xr-xbuild_files/utils/make_update.py67
1 files changed, 67 insertions, 0 deletions
diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py
new file mode 100755
index 00000000000..d737c3772b7
--- /dev/null
+++ b/build_files/utils/make_update.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python3
+
+import os
+import re
+import subprocess
+import sys
+
+def call(cmd):
+ print(" ".join(cmd))
+ retcode = subprocess.call(cmd)
+ if retcode != 0:
+ sys.exit(retcode)
+
+def print_stage(text):
+ print("")
+ print(text)
+ print("")
+
+# 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/"
+
+# Checkout precompiled libraries
+if sys.platform == 'darwin':
+ lib_platform = "darwin"
+elif sys.platform == 'win32':
+ # Windows checkout is usually handled by bat scripts since python3 to run
+ # this script is bundled as part of the precompiled libraries. However it
+ # is used by the buildbot.
+ lib_platform = "win64_vc14"
+else:
+ # No precompiled libraries for Linux.
+ lib_platform = None
+
+if lib_platform:
+ lib_platform_dirpath = os.path.join(lib_dirpath, lib_platform)
+
+ if not os.path.exists(lib_platform_dirpath):
+ print_stage("Checking out Precompiled Libraries")
+
+ svn_url_platform = svn_url + lib_platform
+ call(["svn", "checkout", svn_url_platform, lib_platform_dirpath])
+
+# Update precompiled libraries and tests
+print_stage("Updating Precompiled Libraries and Tests")
+
+if os.path.isdir(lib_dirpath):
+ for dirname in os.listdir(lib_dirpath):
+ if dirname == ".svn":
+ continue
+
+ dirpath = os.path.join(lib_dirpath, dirname)
+ svn_dirpath = os.path.join(dirpath, ".svn")
+ svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
+
+ if os.path.isdir(dirpath) and \
+ (os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath)):
+ call(["svn", "cleanup", dirpath])
+ call(["svn", "update", dirpath])
+
+# Update blender repository and submodules
+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"])