]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Update windows and linux run scripts file to use Python3
authorYunhua Feng <yunhuax.feng@intel.com>
Wed, 5 Sep 2018 09:27:05 +0000 (17:27 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Sat, 13 Oct 2018 01:57:14 +0000 (09:57 +0800)
Modify windows script, PosixLike script, edksetup.sh, edksetup.bat to
use Python3

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
30 files changed:
BaseTools/BinWrappers/PosixLike/BPDG
BaseTools/BinWrappers/PosixLike/Ecc
BaseTools/BinWrappers/PosixLike/GenDepex
BaseTools/BinWrappers/PosixLike/GenFds
BaseTools/BinWrappers/PosixLike/GenPatchPcdTable
BaseTools/BinWrappers/PosixLike/GenerateCapsule
BaseTools/BinWrappers/PosixLike/PatchPcdValue
BaseTools/BinWrappers/PosixLike/Pkcs7Sign
BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys
BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign
BaseTools/BinWrappers/PosixLike/TargetTool
BaseTools/BinWrappers/PosixLike/Trim
BaseTools/BinWrappers/PosixLike/UPT
BaseTools/BinWrappers/PosixLike/build
BaseTools/BinWrappers/WindowsLike/BPDG.bat
BaseTools/BinWrappers/WindowsLike/Ecc.bat
BaseTools/BinWrappers/WindowsLike/GenDepex.bat
BaseTools/BinWrappers/WindowsLike/GenFds.bat
BaseTools/BinWrappers/WindowsLike/GenPatchPcdTable.bat
BaseTools/BinWrappers/WindowsLike/GenerateCapsule.bat
BaseTools/BinWrappers/WindowsLike/PatchPcdValue.bat
BaseTools/BinWrappers/WindowsLike/Pkcs7Sign.bat
BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat
BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256Sign.bat
BaseTools/BinWrappers/WindowsLike/TargetTool.bat
BaseTools/BinWrappers/WindowsLike/Trim.bat
BaseTools/BinWrappers/WindowsLike/UPT.bat
BaseTools/BinWrappers/WindowsLike/build.bat
BaseTools/toolsetup.bat
edksetup.sh

index 276c7ea20733d78a8ebd1fe1152f6e54b1ffc4ce..99dcf99657b863a171ad701f17292229a3039cdf 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 11429640283c69da29429a10c796cdb2adea8126..0032408fa133ace0f4c47b07a66cb4e65be89abb 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index dad174788bc3e8515267b76b272ace08ebbc9de1..f1bd62d7bd6da5b4ac9b1e4abf76b0822b68a155 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 276c7ea20733d78a8ebd1fe1152f6e54b1ffc4ce..99dcf99657b863a171ad701f17292229a3039cdf 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 01ae23ddeb4f8845ce89ec4656d12ef43bf6a58b..76effb6da078ae795b92d73a25ebce8c2fa39cfa 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 59a6c8ba431ec1ef634a572a2a3eecc6f9a4e10d..3a1bd4d4e9401b69cd56cf2c85979e4461aeec9f 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 01ae23ddeb4f8845ce89ec4656d12ef43bf6a58b..76effb6da078ae795b92d73a25ebce8c2fa39cfa 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 01ae23ddeb4f8845ce89ec4656d12ef43bf6a58b..76effb6da078ae795b92d73a25ebce8c2fa39cfa 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 1bc1054a3452a196cdfa1d2e18dde0f7250f20a2..0d7872d24d952d37b7a76e92c9f5392b33916fd2 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 01ae23ddeb4f8845ce89ec4656d12ef43bf6a58b..76effb6da078ae795b92d73a25ebce8c2fa39cfa 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 01ae23ddeb4f8845ce89ec4656d12ef43bf6a58b..76effb6da078ae795b92d73a25ebce8c2fa39cfa 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 6c8dde5bec3eae83e0762f8f36eeb3ab279e86df..f36bd69d26fd648758f8c2bcc6ab00793257eca4 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 01ae23ddeb4f8845ce89ec4656d12ef43bf6a58b..76effb6da078ae795b92d73a25ebce8c2fa39cfa 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 01ae23ddeb4f8845ce89ec4656d12ef43bf6a58b..76effb6da078ae795b92d73a25ebce8c2fa39cfa 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
 #!/usr/bin/env bash
 #python `dirname $0`/RunToolFromSource.py `basename $0` $*
 
-# If a python2 command is available, use it in preference to python
-if command -v python2 >/dev/null 2>&1; then
-    python_exe=python2
+# If a PYTHON3 command is available, use it in preference to python
+if command -v $PYTHON3 >/dev/null 2>&1; then
+    python_exe=$PYTHON3
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
 fi
 
 full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
index 98095cfbd4390c89f17ce74d486951933f2e8dc4..8e2211e3c1f4840e151f231cf01f5b8418692ef3 100644 (file)
@@ -1,4 +1,4 @@
 @setlocal\r
 @set ToolName=%~n0%\r
 @set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python\r
 @setlocal\r
 @set ToolName=%~n0%\r
 @set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python\r
-@%PYTHON_HOME%\python.exe -m %ToolName%.%ToolName% %*\r
+@%PYTHON3% -m %ToolName%.%ToolName% %*\r
index 8705e7541e62fd24dba5c3e718700163fdf2fe06..151d9e730d5d5f34349f6df30582e163cb318ce0 100644 (file)
@@ -1,4 +1,4 @@
 @setlocal\r
 @set ToolName=%~n0%\r
 @set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python\r
 @setlocal\r
 @set ToolName=%~n0%\r
 @set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python\r
-@%PYTHON_HOME%\python.exe -m %ToolName%.EccMain %*\r
+@%PYTHON3% -m %ToolName%.EccMain %*\r
index ffc783d2bebf1930b1f194d68f7e87a98488a20d..e8e5753ce3942616dfe6099393033bd4963162a2 100644 (file)
@@ -1,3 +1,3 @@
 @setlocal\r
 @set ToolName=%~n0%\r
 @setlocal\r
 @set ToolName=%~n0%\r
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\AutoGen\%ToolName%.py %*\r
+@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\AutoGen\%ToolName%.py %*\r
index 98095cfbd4390c89f17ce74d486951933f2e8dc4..8e2211e3c1f4840e151f231cf01f5b8418692ef3 100644 (file)
@@ -1,4 +1,4 @@
 @setlocal\r
 @set ToolName=%~n0%\r
 @set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python\r
 @setlocal\r
 @set ToolName=%~n0%\r
 @set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python\r
-@%PYTHON_HOME%\python.exe -m %ToolName%.%ToolName% %*\r
+@%PYTHON3% -m %ToolName%.%ToolName% %*\r
index 9fbb704a6eb00baca50f39f0cc3fa6b9d30525f3..160347c7008ad637e7ce65edf33c277e1d1c1c62 100644 (file)
@@ -1,3 +1,3 @@
 @setlocal\r
 @set ToolName=%~n0%\r
 @setlocal\r
 @set ToolName=%~n0%\r
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
+@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
index ca442d181b8d7bc3aeb6c87c7dc2dc62bab9beb1..a498b1efc540306e797282725903086b6416be42 100644 (file)
@@ -1 +1 @@
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\Capsule\GenerateCapsule.py %*\r
+@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\Capsule\GenerateCapsule.py %*\r
index 9fbb704a6eb00baca50f39f0cc3fa6b9d30525f3..160347c7008ad637e7ce65edf33c277e1d1c1c62 100644 (file)
@@ -1,3 +1,3 @@
 @setlocal\r
 @set ToolName=%~n0%\r
 @setlocal\r
 @set ToolName=%~n0%\r
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
+@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
index 9fbb704a6eb00baca50f39f0cc3fa6b9d30525f3..160347c7008ad637e7ce65edf33c277e1d1c1c62 100644 (file)
@@ -1,3 +1,3 @@
 @setlocal\r
 @set ToolName=%~n0%\r
 @setlocal\r
 @set ToolName=%~n0%\r
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
+@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
index df9336567cb56cbc8434397af1b941b3641248d3..c3323a742d526e05d1563d1c77b5eb2f689a2e17 100644 (file)
@@ -1 +1 @@
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\Rsa2048Sha256Sign\Rsa2048Sha256GenerateKeys.py %*\r
+@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\Rsa2048Sha256Sign\Rsa2048Sha256GenerateKeys.py %*\r
index 9fbb704a6eb00baca50f39f0cc3fa6b9d30525f3..160347c7008ad637e7ce65edf33c277e1d1c1c62 100644 (file)
@@ -1,3 +1,3 @@
 @setlocal\r
 @set ToolName=%~n0%\r
 @setlocal\r
 @set ToolName=%~n0%\r
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
+@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
index 9fbb704a6eb00baca50f39f0cc3fa6b9d30525f3..160347c7008ad637e7ce65edf33c277e1d1c1c62 100644 (file)
@@ -1,3 +1,3 @@
 @setlocal\r
 @set ToolName=%~n0%\r
 @setlocal\r
 @set ToolName=%~n0%\r
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
+@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
index 9fbb704a6eb00baca50f39f0cc3fa6b9d30525f3..160347c7008ad637e7ce65edf33c277e1d1c1c62 100644 (file)
@@ -1,3 +1,3 @@
 @setlocal\r
 @set ToolName=%~n0%\r
 @setlocal\r
 @set ToolName=%~n0%\r
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
+@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
index 9fbb704a6eb00baca50f39f0cc3fa6b9d30525f3..160347c7008ad637e7ce65edf33c277e1d1c1c62 100644 (file)
@@ -1,3 +1,3 @@
 @setlocal\r
 @set ToolName=%~n0%\r
 @setlocal\r
 @set ToolName=%~n0%\r
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
+@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
index 9fbb704a6eb00baca50f39f0cc3fa6b9d30525f3..160347c7008ad637e7ce65edf33c277e1d1c1c62 100644 (file)
@@ -1,3 +1,3 @@
 @setlocal\r
 @set ToolName=%~n0%\r
 @setlocal\r
 @set ToolName=%~n0%\r
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
+@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
index 33d50f58ad87df6909ae7dbcc691cd5503e3789e..0d4028db785f573e9ddf4a3f9b3694d3e4bfac09 100755 (executable)
@@ -299,18 +299,32 @@ goto end
      )\r
   )\r
 \r
      )\r
   )\r
 \r
-  if not defined PYTHON_HOME (\r
-    if defined PYTHONHOME (\r
-      set PYTHON_HOME=%PYTHONHOME%\r
-    ) else (\r
-      echo.\r
-      echo !!! ERROR !!! Binary python tools are missing. PYTHON_HOME environment variable is not set.\r
-      echo PYTHON_HOME is required to build or execute the python tools.\r
-      echo.\r
-      goto end\r
+set PYTHON3=py -3\r
+:check_python_version\r
+  %PYTHON3% --version >NUL 2>&1\r
+  if %ERRORLEVEL% NEQ 0 (\r
+    if defined PYTHON_HOME (\r
+      if EXIST "%PYTHON_HOME%" (\r
+        set PYTHON3=%PYTHON_HOME%\python.exe\r
+      )\r
     )\r
   )\r
     )\r
   )\r
+  %PYTHON3% --version >NUL 2>&1\r
+  if %ERRORLEVEL% NEQ 0 (\r
+     echo.\r
+     echo !!! ERROR !!!  %PYTHON3% not install.\r
+     echo.\r
+     goto end\r
+   )\r
+  FOR /F "TOKENS=1,2" %%i IN ('%PYTHON3% --version') DO set VERSION=%%j\r
+  if /I "%VERSION%" LSS "3.6" (\r
+     echo.\r
+     echo !!! ERROR !!!  python version should greater than or equal to version 3.6.\r
+     echo.\r
+     goto end\r
+  )\r
 \r
 \r
+:check_freezer_path\r
   @REM We have Python, now test for FreezePython application\r
   if not defined PYTHON_FREEZER_PATH (\r
     echo.\r
   @REM We have Python, now test for FreezePython application\r
   if not defined PYTHON_FREEZER_PATH (\r
     echo.\r
index 93d652575804d49f9922862f51c862ad98552091..d4e577e607811fa90f712c8e691a70c6218f13ee 100755 (executable)
@@ -111,10 +111,41 @@ function SetupEnv()
   fi
 }
 
   fi
 }
 
+function SetupPython3()
+{
+  for python in $(whereis python3)
+  do
+    python=$(echo $python | grep "[[:digit:]]$" || true)
+    python_version=${python##*python}
+    if [ -z "${python_version}" ];then
+      continue
+    fi
+    if [ -z $origin_version ];then
+      origin_version=$python_version
+      export PYTHON3=$python
+      continue
+    fi
+    ret=`echo "$origin_version < $python_version" |bc`
+    if [ "$ret" -eq 1 ]; then
+      origin_version=$python_version
+      export PYTHON3=$python
+    fi
+  done
+  if [ -z "$origin_version" ] || [ `echo "$origin_version < 3.6" |bc` -eq 1 ]; then
+    echo
+    echo ERROR!!!, python version should greater than or equal to version 3.6.
+    echo 
+    return 1
+  fi
+
+}
+
 function SourceEnv()
 {
   SetWorkspace &&
   SetupEnv
 function SourceEnv()
 {
   SetWorkspace &&
   SetupEnv
+  SetupPython3
 }
 
 I=$#
 }
 
 I=$#