From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 8674A81F07 for ; Tue, 24 Jan 2017 19:21:19 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 24 Jan 2017 19:21:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,282,1477983600"; d="scan'208";a="217287735" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 24 Jan 2017 19:21:19 -0800 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 24 Jan 2017 19:21:19 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 24 Jan 2017 19:21:18 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Wed, 25 Jan 2017 11:21:15 +0800 From: "Gao, Liming" To: "kyletpugh@gmail.com" , "edk2-devel@lists.01.org" CC: Laszlo Ersek , "Zhu, Yonghong" Thread-Topic: [PATCH v1 1/1] BaseTools: AutoGen: Expand macros in INF files Thread-Index: AQHSdnY5Xs6GUNbvjE2ogKdUHuYKSaFIgYYg Date: Wed, 25 Jan 2017 03:21:14 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D6D47EA@shsmsx102.ccr.corp.intel.com> References: <20170124191557.5404-1-apianti@users.sourceforge.net> <20170124191557.5404-2-apianti@users.sourceforge.net> In-Reply-To: <20170124191557.5404-2-apianti@users.sourceforge.net> 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 v1 1/1] BaseTools: AutoGen: Expand macros in INF files 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: Wed, 25 Jan 2017 03:21:19 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi,=20 This usage will break UDP (UEFI Platform Initialization Distribution Pack= aging Specification). It can be downloaded from http://www.uefi.org/specif= ications. This spec defines the packaging format. It defines SourceFiles.Fi= lename as the path (relative to the Module "root" directory) and filename o= f the file (as specified in the Distribution Content File.) That means sour= ce files must be in the module directory.=20 And, EDK2 BaseTools UPT tool follows UDP to create Package.dist based on = edk2 source Package, and install Package.dist to edk2 source package. If so= urce package has no change, UPT should always create the same package.dist = file. But, this feature will break it. So, I don't suggest to add this supp= ort.=20 Thanks Liming >-----Original Message----- >From: kyletpugh@gmail.com [mailto:kyletpugh@gmail.com] >Sent: Wednesday, January 25, 2017 3:16 AM >To: edk2-devel@lists.01.org >Cc: Laszlo Ersek ; Zhu, Yonghong >; Gao, Liming >Subject: [PATCH v1 1/1] BaseTools: AutoGen: Expand macros in INF files > >From: apianti > >Expand environment macros used for paths and names in INF files > >Cc: Laszlo Ersek >Cc: Yonghong Zhu >Cc: Liming Gao >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: apianti >--- > BaseTools/Source/Python/AutoGen/GenC.py | 4 ++-- > BaseTools/Source/Python/AutoGen/GenMake.py | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/BaseTools/Source/Python/AutoGen/GenC.py >b/BaseTools/Source/Python/AutoGen/GenC.py >index 63cfe0422bbc..866e906f2f89 100644 >--- a/BaseTools/Source/Python/AutoGen/GenC.py >+++ b/BaseTools/Source/Python/AutoGen/GenC.py >@@ -21,7 +21,7 @@ from Common import EdkLogger > from Common.BuildToolError import * > from Common.DataType import * > from Common.Misc import * >-from Common.String import StringToArray >+from Common.String import StringToArray, ReplaceMacro > from StrGather import * > from GenPcdDb import CreatePcdDatabaseCode > from IdfClassObject import * >@@ -1911,7 +1911,7 @@ def CreateHeaderCode(Info, AutoGenC, AutoGenH): > # Publish the CallerId Guid > # > AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED GUID >gEfiCallerIdGuid =3D %s;\n' % GuidStringToGuidStructureString(Info.Guid)) >- AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED CHAR8 >*gEfiCallerBaseName =3D "%s";\n' % Info.Name) >+ AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED CHAR8 >*gEfiCallerBaseName =3D "%s";\n' % ReplaceMacro(Info.Name, os.environ)) > > ## Create common code for header file > # >diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py >b/BaseTools/Source/Python/AutoGen/GenMake.py >index 51c5238fd17e..7ec59fca5271 100644 >--- a/BaseTools/Source/Python/AutoGen/GenMake.py >+++ b/BaseTools/Source/Python/AutoGen/GenMake.py >@@ -587,7 +587,7 @@ cleanlib: > FileMacroList.append("%s =3D %s" % (ListFileMacro, ListFileNa= me)) > SaveFileOnChange( > ListFileName, >- "\n".join(self.ListFileMacros[ListFileMacro]), >+ "\n".join(ReplaceMacros(self.ListFileMacros[ListFileMacro= ], >os.environ)), > False > ) > >-- >2.11.0.windows.1