[Bf-blender-cvs] [018fe9e006a] master: Build: move "make update" on macOS and Linux to Python script

Brecht Van Lommel noreply at git.blender.org
Fri Aug 30 18:04:06 CEST 2019


Commit: 018fe9e006a87daa26c4f3f49220f43884cf32df
Author: Brecht Van Lommel
Date:   Tue Aug 20 12:05:03 2019 +0200
Branches: master
https://developer.blender.org/rB018fe9e006a87daa26c4f3f49220f43884cf32df

Build: move "make update" on macOS and Linux to Python script

Differential Revision: https://developer.blender.org/D5545

===================================================================

M	GNUmakefile
A	build_files/utils/make_update.py

===================================================================

diff --git a/GNUmakefile b/GNUmakefile
index d17596d203d..92d1efca21d 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -531,17 +531,7 @@ icons_geom: .FORCE
 	    "$(BLENDER_DIR)/release/datafiles/blender_icons_geom_update.py"
 
 update: .FORCE
-	if [ "$(OS_NCASE)" = "darwin" ] && [ ! -d "../lib/$(OS_NCASE)" ]; then \
-		svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/$(OS_NCASE) ../lib/$(OS_NCASE) ; \
-	fi
-	if [ -d "../lib" ]; then \
-		svn cleanup ../lib/* ; \
-		svn update ../lib/* ; \
-	fi
-	git pull --rebase
-	git submodule update --init --recursive
-	git submodule foreach git checkout master
-	git submodule foreach git pull --rebase origin master
+	python3 ./build_files/utils/make_update.py
 
 format: .FORCE
 	PATH="../lib/${OS_NCASE}/llvm/bin/:$(PATH)" \
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"])



More information about the Bf-blender-cvs mailing list