From nobody Fri May 3 12:01:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1530094100580689.4168356735435; Wed, 27 Jun 2018 03:08:20 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 93379202E540F; Wed, 27 Jun 2018 03:08:19 -0700 (PDT) Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AFE87211F8899 for ; Wed, 27 Jun 2018 03:08:17 -0700 (PDT) Received: from localhost.localdomain (unknown.telstraglobal.net [134.159.103.118]) by smtp.nue.novell.com with ESMTP (NOT encrypted); Wed, 27 Jun 2018 12:08:14 +0200 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.221.5; helo=smtp.nue.novell.com; envelope-from=glin@suse.com; receiver=edk2-devel@lists.01.org From: Gary Lin To: edk2-devel@lists.01.org Date: Wed, 27 Jun 2018 18:07:55 +0800 Message-Id: <20180627100757.3405-2-glin@suse.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180627100757.3405-1-glin@suse.com> References: <20180627100757.3405-1-glin@suse.com> Subject: [edk2] [PATCH 1/3] BaseTools: Remove the old python "not-equal" in DscBuildData.py X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Replace "<>" with "!=3D" to be compatible with python3. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/Source/Python/Workspace/DscBuildData.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 06732e6fade4..5cc814185eb9 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -2108,7 +2108,7 @@ class DscBuildData(PlatformBuildClassObject): Messages =3D StdErr Messages =3D Messages.split('\n') MessageGroup =3D [] - if returncode <>0: + if returncode !=3D 0: CAppBaseFileName =3D os.path.join(self.OutputPath, PcdValueIni= tName) File =3D open (CAppBaseFileName + '.c', 'r') FileData =3D File.readlines() --=20 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri May 3 12:01:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 15300941031651001.8256710530201; Wed, 27 Jun 2018 03:08:23 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BD155202E5418; Wed, 27 Jun 2018 03:08:21 -0700 (PDT) Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 75438202E540B for ; Wed, 27 Jun 2018 03:08:19 -0700 (PDT) Received: from localhost.localdomain (unknown.telstraglobal.net [134.159.103.118]) by smtp.nue.novell.com with ESMTP (NOT encrypted); Wed, 27 Jun 2018 12:08:16 +0200 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.221.5; helo=smtp.nue.novell.com; envelope-from=glin@suse.com; receiver=edk2-devel@lists.01.org From: Gary Lin To: edk2-devel@lists.01.org Date: Wed, 27 Jun 2018 18:07:56 +0800 Message-Id: <20180627100757.3405-3-glin@suse.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180627100757.3405-1-glin@suse.com> References: <20180627100757.3405-1-glin@suse.com> Subject: [edk2] [PATCH 2/3] BaseTools: Unify long and int in Expression.py X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Per PEP237(*), 'long' is unified with 'int' and removed from python3. * To make the script compatible with both python2 and python3, 'type(0L)' is replaced with 'type(sys.maxsize + 1)'. In python2, the number is 'long', while it's 'int' in python3. We can remove the workaround after moving to python3 completely. * long() is replaced with int() since int() returns a long when need. (*) https://www.python.org/dev/peps/pep-0237/ Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/Source/Python/Common/Expression.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Sourc= e/Python/Common/Expression.py index e1a2c155b7f3..51e8d2174a8f 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -20,6 +20,7 @@ from Misc import GuidStringToGuidStructureString, ParseFi= eldValue, IsFieldValueA import Common.EdkLogger as EdkLogger import copy from Common.DataType import * +import sys =20 ERR_STRING_EXPR =3D 'This operator cannot be used in string expres= sion: [%s].' ERR_SNYTAX =3D 'Syntax error, the rest of expression cannot b= e evaluated: [%s].' @@ -254,7 +255,8 @@ class ValueExpression(BaseExpression): Oprand2 =3D IntToStr(Oprand2) TypeDict =3D { type(0) : 0, - type(0L) : 0, + # For python2 long type + type(sys.maxsize + 1) : 0, type('') : 1, type(True) : 2 } @@ -892,7 +894,7 @@ class ValueExpressionEx(ValueExpression): raise BadExpression('Type %s PCD Value Size is Larger = than 8 byte' % self.PcdType) else: try: - TmpValue =3D long(PcdValue) + TmpValue =3D int(PcdValue) TmpList =3D [] if TmpValue.bit_length() =3D=3D 0: PcdValue =3D '{0x00}' --=20 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri May 3 12:01:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1530094105863603.1462795541087; Wed, 27 Jun 2018 03:08:25 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EB788202E540C; Wed, 27 Jun 2018 03:08:24 -0700 (PDT) Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 447AC211F8899 for ; Wed, 27 Jun 2018 03:08:21 -0700 (PDT) Received: from localhost.localdomain (unknown.telstraglobal.net [134.159.103.118]) by smtp.nue.novell.com with ESMTP (NOT encrypted); Wed, 27 Jun 2018 12:08:18 +0200 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.221.5; helo=smtp.nue.novell.com; envelope-from=glin@suse.com; receiver=edk2-devel@lists.01.org From: Gary Lin To: edk2-devel@lists.01.org Date: Wed, 27 Jun 2018 18:07:57 +0800 Message-Id: <20180627100757.3405-4-glin@suse.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180627100757.3405-1-glin@suse.com> References: <20180627100757.3405-1-glin@suse.com> Subject: [edk2] [PATCH 3/3] BaseTools: Read the env variable PYTHON_DEFAULT X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When PYTHON_DEFAULT is set as "python3", the bash scripts in PosixLike will perfer python3. Currently, this is for the evaluation of the python3 support and errors from the python3 interperter are expected. For example, to build OvmfPkg with python3: $ export PYTHON_DEFAULT=3Dpython3 $ ./OvmfPkg/build.sh Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/BinWrappers/PosixLike/BPDG | 6 +++++- BaseTools/BinWrappers/PosixLike/Ecc | 6 +++++- BaseTools/BinWrappers/PosixLike/GenDepex | 6 +++++- BaseTools/BinWrappers/PosixLike/GenFds | 6 +++++- BaseTools/BinWrappers/PosixLike/GenPatchPcdTable | 6 +++++- BaseTools/BinWrappers/PosixLike/PatchPcdValue | 6 +++++- BaseTools/BinWrappers/PosixLike/Pkcs7Sign | 6 +++++- BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys | 6 +++++- BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign | 6 +++++- BaseTools/BinWrappers/PosixLike/TargetTool | 6 +++++- BaseTools/BinWrappers/PosixLike/Trim | 6 +++++- BaseTools/BinWrappers/PosixLike/UPT | 6 +++++- BaseTools/BinWrappers/PosixLike/build | 6 +++++- 13 files changed, 65 insertions(+), 13 deletions(-) diff --git a/BaseTools/BinWrappers/PosixLike/BPDG b/BaseTools/BinWrappers/P= osixLike/BPDG index 01ae23ddeb4f..aef1bc444a64 100755 --- a/BaseTools/BinWrappers/PosixLike/BPDG +++ b/BaseTools/BinWrappers/PosixLike/BPDG @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 diff --git a/BaseTools/BinWrappers/PosixLike/Ecc b/BaseTools/BinWrappers/Po= sixLike/Ecc index 01ae23ddeb4f..aef1bc444a64 100755 --- a/BaseTools/BinWrappers/PosixLike/Ecc +++ b/BaseTools/BinWrappers/PosixLike/Ecc @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 diff --git a/BaseTools/BinWrappers/PosixLike/GenDepex b/BaseTools/BinWrappe= rs/PosixLike/GenDepex index dad174788bc3..c311d76238e4 100755 --- a/BaseTools/BinWrappers/PosixLike/GenDepex +++ b/BaseTools/BinWrappers/PosixLike/GenDepex @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 diff --git a/BaseTools/BinWrappers/PosixLike/GenFds b/BaseTools/BinWrappers= /PosixLike/GenFds index 01ae23ddeb4f..aef1bc444a64 100755 --- a/BaseTools/BinWrappers/PosixLike/GenFds +++ b/BaseTools/BinWrappers/PosixLike/GenFds @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 diff --git a/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable b/BaseTools/B= inWrappers/PosixLike/GenPatchPcdTable index 01ae23ddeb4f..aef1bc444a64 100755 --- a/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable +++ b/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 diff --git a/BaseTools/BinWrappers/PosixLike/PatchPcdValue b/BaseTools/BinW= rappers/PosixLike/PatchPcdValue index 01ae23ddeb4f..aef1bc444a64 100755 --- a/BaseTools/BinWrappers/PosixLike/PatchPcdValue +++ b/BaseTools/BinWrappers/PosixLike/PatchPcdValue @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 diff --git a/BaseTools/BinWrappers/PosixLike/Pkcs7Sign b/BaseTools/BinWrapp= ers/PosixLike/Pkcs7Sign index 01ae23ddeb4f..aef1bc444a64 100755 --- a/BaseTools/BinWrappers/PosixLike/Pkcs7Sign +++ b/BaseTools/BinWrappers/PosixLike/Pkcs7Sign @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 diff --git a/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys b/Ba= seTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys index 1bc1054a3452..d6f3d0e23083 100755 --- a/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys +++ b/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 diff --git a/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign b/BaseTools/= BinWrappers/PosixLike/Rsa2048Sha256Sign index 01ae23ddeb4f..aef1bc444a64 100755 --- a/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign +++ b/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 diff --git a/BaseTools/BinWrappers/PosixLike/TargetTool b/BaseTools/BinWrap= pers/PosixLike/TargetTool index 01ae23ddeb4f..aef1bc444a64 100755 --- a/BaseTools/BinWrappers/PosixLike/TargetTool +++ b/BaseTools/BinWrappers/PosixLike/TargetTool @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 diff --git a/BaseTools/BinWrappers/PosixLike/Trim b/BaseTools/BinWrappers/P= osixLike/Trim index 6c8dde5bec3e..6ec76c3a45c9 100755 --- a/BaseTools/BinWrappers/PosixLike/Trim +++ b/BaseTools/BinWrappers/PosixLike/Trim @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 diff --git a/BaseTools/BinWrappers/PosixLike/UPT b/BaseTools/BinWrappers/Po= sixLike/UPT index 01ae23ddeb4f..aef1bc444a64 100755 --- a/BaseTools/BinWrappers/PosixLike/UPT +++ b/BaseTools/BinWrappers/PosixLike/UPT @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 diff --git a/BaseTools/BinWrappers/PosixLike/build b/BaseTools/BinWrappers/= PosixLike/build index 01ae23ddeb4f..aef1bc444a64 100755 --- a/BaseTools/BinWrappers/PosixLike/build +++ b/BaseTools/BinWrappers/PosixLike/build @@ -1,8 +1,12 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* =20 +# If a python3 command is available and PYTHON_DEFAULT is "python3", +# use it in preference to python +if test "$PYTHON_DEFAULT" =3D=3D "python3" && command -v python3 >/dev/nul= l 2>&1; then + python_exe=3Dpython3 # If a python2 command is available, use it in preference to python -if command -v python2 >/dev/null 2>&1; then +elif command -v python2 >/dev/null 2>&1; then python_exe=3Dpython2 fi =20 --=20 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel