[Bf-blender-cvs] [f2faebe] master: Fix compilation error with SCons when using BUILDINFO and git is not found

Sergey Sharybin noreply at git.blender.org
Sat Nov 16 19:45:57 CET 2013


Commit: f2faebe9cf6aea833f60da93efcffb7f0c271d82
Author: Sergey Sharybin
Date:   Sun Nov 17 00:45:11 2013 +0600
http://developer.blender.org/rBf2faebe9cf6aea833f60da93efcffb7f0c271d82

Fix compilation error with SCons when using BUILDINFO and git is not found

Fallback to "no buildinfo" mode in this case.

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

M	build_files/scons/tools/Blender.py

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

diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py
index fac8195..ca3f94a 100644
--- a/build_files/scons/tools/Blender.py
+++ b/build_files/scons/tools/Blender.py
@@ -410,10 +410,17 @@ def buildinfo(lenv, build_type):
     """
     build_date = time.strftime ("%Y-%m-%d")
     build_time = time.strftime ("%H:%M:%S")
+
     if os.path.isdir(os.path.abspath('.git')):
         build_commit_timestamp = os.popen('git log -1 --format=%ct').read().strip()
-        build_hash = os.popen('git rev-parse --short HEAD').read().strip()
-        build_branch = os.popen('git rev-parse --abbrev-ref HEAD').read().strip()
+        if not build_commit_timestamp:
+            # Git command not found
+            build_hash = 'unknown'
+            build_commit_timestamp = '0'
+            build_branch = 'unknown'
+        else:
+            build_hash = os.popen('git rev-parse --short HEAD').read().strip()
+            build_branch = os.popen('git rev-parse --abbrev-ref HEAD').read().strip()
     else:
         build_hash = 'unknown'
         build_commit_timestamp = '0'




More information about the Bf-blender-cvs mailing list