summaryrefslogtreecommitdiffstats
path: root/scons/custom.py
diff options
context:
space:
mode:
authorpal1000 <[email protected]>2019-03-07 10:38:10 +0200
committerJose Fonseca <[email protected]>2019-03-12 14:22:34 +0000
commit7f89fd17ed2b1bd0c0fe4ec946dcabed0f8c74d3 (patch)
tree7d20d80dd094cfd1f0c14f7dc66aba5fb854313b /scons/custom.py
parentbef354321b8e55dd68ad1769504f55fb63da1294 (diff)
scons: Compatibility with Scons development version string
This ensures Mesa3D build doesn't fail in this case as encountered when bisecting Scons source code while regression testing https://bugs.freedesktop.org/show_bug.cgi?id=109443 and when testing 3.0.5.a.2 Technical details: Scons version string has consistently been in this format: MajorVersion.MinorVersion.Patch[.alpha/beta.yyyymmdd] so these formulas should strip alpha/beta flags and return Scons version: - as string - `'.'.join(SCons.__version__.split('.')[:3])` - as tuple of integers - `tuple(map(int, SCons.__version__.split('.')[:3]))` - v2: Fixed Scons version retrieval formulas as string and tuple of integers. - v3: Fixed Scons version string format description. Cc: "19.0" <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'scons/custom.py')
-rw-r--r--scons/custom.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scons/custom.py b/scons/custom.py
index 09946fa7324..8028990ef61 100644
--- a/scons/custom.py
+++ b/scons/custom.py
@@ -48,7 +48,12 @@ import source_list
# a path directly. We want to support both, so we need to detect the SCons version,
# for which no API is provided by SCons 8-P
-scons_version = tuple(map(int, SCons.__version__.split('.')))
+# Scons version string has consistently been in this format:
+# MajorVersion.MinorVersion.Patch[.alpha/beta.yyyymmdd]
+# so this formula should cover all versions regardless of type
+# stable, alpha or beta.
+# For simplicity alpha and beta flags are removed.
+scons_version = tuple(map(int, SCons.__version__.split('.')[:3]))
def quietCommandLines(env):
# Quiet command lines