jjb: Add support for python3.10 in build scripts
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 13 Apr 2022 17:51:22 +0000 (13:51 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Wed, 13 Apr 2022 17:54:02 +0000 (13:54 -0400)
Change-Id: I9aae281e89602c18970d5e2d9d497a3017e14127
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
scripts/lttng-analyses/build.sh
scripts/lttng-analyses/pylint.sh
scripts/lttng-ivc/build.sh
scripts/lttng-tools/build.sh
scripts/lttng-tools/release.sh
scripts/lttng-ust-benchmarks/build.sh

index de86ae89e213845f30f851c2bda7b87975741855..8f06e69a1a41d002997385b83559083c3999c5dd 100755 (executable)
@@ -23,7 +23,7 @@ set -exu
 SRCDIR="src/lttng-analyses"
 
 PYTHON3="python3"
-P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])")
+P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))')
 
 BABELTRACE_DIR=$WORKSPACE/deps/babeltrace/build
 
index 426fcc4b6632b6a4e01d02ec2d96544281de8d27..7f3ec6e87eb30fc01b987c356cd5a1786afaa92c 100755 (executable)
@@ -20,7 +20,7 @@ set -exu
 SRCDIR="src/lttng-analyses"
 
 PYTHON3="python3"
-P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])")
+P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))')
 
 BABELTRACE_DIR=$WORKSPACE/deps/babeltrace/build
 
index 08f6b9b8817a11d39074ee86091a31e475994f05..83cbefc291529db55674aa1ab6ce841308cd723d 100644 (file)
@@ -16,7 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 PYTHON3="python3"
-P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])")
+P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))')
 
 # Tox does not support long path venv for whatever reason.
 PYENV_HOME=$(mktemp -d)
index 945426987f63260fcd6ad535d52b2e459f11536c..b54b6fc0943e04e9683daed12e0a807f7663f9a5 100755 (executable)
@@ -275,8 +275,8 @@ cygwin|cygwin64|msys32|msys64)
     PYTHON2=python2
     PYTHON3=python3
 
-    P2_VERSION=$($PYTHON2 -c "import sys;print(sys.version[:3])")
-    P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])")
+    P2_VERSION=$($PYTHON2 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))')
+    P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))')
 
     DEPS_PYTHON2="$WORKSPACE/deps/build/lib/python$P2_VERSION/site-packages"
     DEPS_PYTHON3="$WORKSPACE/deps/build/lib/python$P3_VERSION/site-packages"
index a199494fdab5b2be6d0d068f0d6671f4947fe5dd..c6e6ce222cb2f4fd55e693fba143bf78ec634db5 100644 (file)
@@ -128,8 +128,8 @@ PYTHON3=python3
 export PYTHON="$PYTHON3"
 export PYTHON_CONFIG="/usr/bin/$PYTHON3-config"
 
-P2_VERSION=$($PYTHON2 -c "import sys;print(sys.version[:3])")
-P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])")
+P2_VERSION=$($PYTHON2 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))')
+P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))')
 
 UST_PYTHON2="$WORKSPACE/deps/build/lib/python$P2_VERSION/site-packages"
 UST_PYTHON3="$WORKSPACE/deps/build/lib/python$P3_VERSION/site-packages"
index a2799b9d1abf95a36ec01ece0868ce86457ce884..13e6d639d383d5b7e3b34f7c09737dff05feadf8 100644 (file)
@@ -25,7 +25,7 @@ rm -rf "$WORKSPACE/build"
 mkdir -p "$WORKSPACE/build"
 
 PYTHON3=python3
-P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])")
+P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))')
 
 # liburcu
 URCU_INCS="$WORKSPACE/deps/liburcu/build/include/"
This page took 0.028904 seconds and 4 git commands to generate.