From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 1304F81F44 for ; Thu, 1 Dec 2016 18:50:57 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 01 Dec 2016 18:50:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,284,1477983600"; d="scan'208";a="38118003" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 01 Dec 2016 18:50:56 -0800 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 1 Dec 2016 18:50:56 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 1 Dec 2016 18:50:56 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.239]) with mapi id 14.03.0248.002; Fri, 2 Dec 2016 10:50:53 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Support QuotedString for PREBUILD/POSTBUILD in DSC file Thread-Index: AQHSSuMW6VgtVkxRm0qFWqYiRCXeqqDz9/2g Date: Fri, 2 Dec 2016 02:50:53 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B4BC3F5@shsmsx102.ccr.corp.intel.com> References: <1480494210-22876-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1480494210-22876-1-git-send-email-yonghong.zhu@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: Support QuotedString for PREBUILD/POSTBUILD in DSC file X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 02:50:57 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao -----Original Message----- From: Zhu, Yonghong=20 Sent: Wednesday, November 30, 2016 4:24 PM To: edk2-devel@lists.01.org Cc: Gao, Liming Subject: [Patch] BaseTools: Support QuotedString for PREBUILD/POSTBUILD in = DSC file If the prebuild/postbuild script statement start with double quotations, cu= rrent tool report error, while DSC spec allow this usage. so update tool to= support it. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu --- BaseTools/Source/Python/Workspace/WorkspaceDatabase.py | 16 ++++++++++++++= -- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseT= ools/Source/Python/Workspace/WorkspaceDatabase.py index 46179a3..e7bc87d 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py @@ -229,13 +229,25 @@ class DscBuildData(PlatformBuildClassObject): ErrorCode, ErrorInfo =3D self._FlashDefinition.Validate('.= fdf') if ErrorCode !=3D 0: EdkLogger.error('build', ErrorCode, File=3Dself.MetaFi= le, Line=3DRecord[-1], ExtraData=3DErrorInfo) elif Name =3D=3D TAB_DSC_PREBUILD: - self._Prebuild =3D PathClass(NormPath(Record[2], self._Mac= ros), GlobalData.gWorkspace) + PrebuildValue =3D Record[2] + if Record[2][0] =3D=3D '"': + if Record[2][-1] !=3D '"': + EdkLogger.error('build', FORMAT_INVALID, 'Missing = double quotes in the end of %s statement.' % TAB_DSC_PREBUILD, + File=3Dself.MetaFile, Line=3DRecord[-1= ]) + PrebuildValue =3D Record[2][1:-1] + self._Prebuild =3D PathClass(NormPath(PrebuildValue,=20 + self._Macros), GlobalData.gWorkspace) elif Name =3D=3D TAB_DSC_POSTBUILD: - self._Postbuild =3D PathClass(NormPath(Record[2], self._Ma= cros), GlobalData.gWorkspace) + PostbuildValue =3D Record[2] + if Record[2][0] =3D=3D '"': + if Record[2][-1] !=3D '"': + EdkLogger.error('build', FORMAT_INVALID, 'Missing = double quotes in the end of %s statement.' % TAB_DSC_POSTBUILD, + File=3Dself.MetaFile, Line=3DRecord[-1= ]) + PostbuildValue =3D Record[2][1:-1] + self._Postbuild =3D PathClass(NormPath(PostbuildValue,=20 + self._Macros), GlobalData.gWorkspace) elif Name =3D=3D TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES: self._SupArchList =3D GetSplitValueList(Record[2], TAB_VAL= UE_SPLIT) elif Name =3D=3D TAB_DSC_DEFINES_BUILD_TARGETS: self._BuildTargets =3D GetSplitValueList(Record[2]) elif Name =3D=3D TAB_DSC_DEFINES_SKUID_IDENTIFIER: -- 2.6.1.windows.1