From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 7DB9F21163DEA for ; Mon, 8 Oct 2018 20:44:10 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2018 20:44:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,359,1534834800"; d="scan'208";a="97691562" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 08 Oct 2018 20:43:53 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Oct 2018 20:43:52 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Oct 2018 20:43:52 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.111]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.183]) with mapi id 14.03.0319.002; Tue, 9 Oct 2018 11:43:50 +0800 From: "Zhu, Yonghong" To: "edk2-devel@lists.01.org" , "glin@suse.com" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [edk2] [PATCH] BaseTools/edksetup.sh: Handle the return value from grep Thread-Index: AQHUWgEXcsavL6D2pkSs+IB9IpRjQaUWLC5wgAAj8XA= Date: Tue, 9 Oct 2018 03:43:49 +0000 Message-ID: References: <20181002033541.17076-1-glin@suse.com> <47C64442C08CCD4089DC43B6B5E46BC48ECC92@shsmsx102.ccr.corp.intel.com> In-Reply-To: <47C64442C08CCD4089DC43B6B5E46BC48ECC92@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] BaseTools/edksetup.sh: Handle the return value from grep X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2018 03:44:10 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Looks good to me. I will push this to Python3 branch. Reviewed-by: Yonghong Zhu =20 -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Gary= Lin Sent: Tuesday, October 2, 2018 11:36 AM To: edk2-devel@lists.01.org Cc: Gao, Liming Subject: [edk2] [PATCH] BaseTools/edksetup.sh: Handle the return value from= grep When SetupPython3() parses the possible python binary paths, it uses `grep = "[[:digit:]]$"` to filter the python versions in the file name. Since grep would return 1 when the last character of the file name is not a= digit, OvmfPkg/build.sh would fail immediately when the function is handli= ng some cases, e.g. "python3:". This commit adds `|| true` to the grep command to make sure the command nev= er returns 1 in any condition. [NOTE: For the python3 branch] Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Gary Lin Cc: Liming Gao Cc: Yonghong Zhu --- edksetup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edksetup.sh b/edksetup.sh index 5ff3be19fb2f..d4e577e60781 100755 --- a/edksetup.sh +++ b/edksetup.sh @@ -115,7 +115,7 @@ function SetupPython3() { for python in $(whereis python3) do - python=3D$(echo $python | grep "[[:digit:]]$") + python=3D$(echo $python | grep "[[:digit:]]$" || true) python_version=3D${python##*python} if [ -z "${python_version}" ];then continue -- 2.18.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel