From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: bob.c.feng@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Mon, 08 Apr 2019 22:08:48 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Apr 2019 22:08:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,328,1549958400"; d="scan'208";a="336173807" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 08 Apr 2019 22:08:47 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 8 Apr 2019 22:08:47 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.164]) by shsmsx102.ccr.corp.intel.com ([169.254.2.206]) with mapi id 14.03.0415.000; Tue, 9 Apr 2019 13:08:46 +0800 From: "BobCF" To: "Rodriguez, Christian" , "devel@edk2.groups.io" CC: "Gao, Liming" , "Zhu, Yonghong" Subject: Re: [Patch V2 3/4] BaseTools: Fix corner-cases of --hash feature Thread-Topic: [Patch V2 3/4] BaseTools: Fix corner-cases of --hash feature Thread-Index: AQHU6wAn3H77x8noLUenIyutaSlKFaYzToAg Date: Tue, 9 Apr 2019 05:08:45 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D1600DB375@SHSMSX101.ccr.corp.intel.com> References: <20190404160423.5268-1-christian.rodriguez@intel.com> <20190404160423.5268-4-christian.rodriguez@intel.com> In-Reply-To: <20190404160423.5268-4-christian.rodriguez@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Rodriguez, Christian=20 Sent: Friday, April 5, 2019 12:04 AM To: devel@edk2.groups.io Cc: Feng, Bob C ; Gao, Liming ;= Zhu, Yonghong Subject: [Patch V2 3/4] BaseTools: Fix corner-cases of --hash feature BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1680 Respect artifact location within directory structure. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Christian Rodriguez Cc: Bob Feng Cc: Liming Gao Cc: Yonghong Zhu --- BaseTools/Source/Python/AutoGen/AutoGen.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index b516404696..d087ca5e0e 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3906,9 +3906,11 @@ class ModuleAutoGen(AutoGen): FileDir =3D path.join(GlobalData.gBinCacheDest, self.Arch, self.So= urceDir, self.MetaFile.BaseName) CreateDirectory (FileDir) HashFile =3D path.join(self.BuildDir, self.Name + '.hash') - ModuleFile =3D path.join(self.OutputDir, self.Name + '.inf') if os.path.exists(HashFile): shutil.copy2(HashFile, FileDir) + if self.IsLibrary: + return + ModuleFile =3D path.join(self.OutputDir, self.Name + '.inf') if os.path.exists(ModuleFile): shutil.copy2(ModuleFile, FileDir) if not self.OutputFile: @@ -3920,7 +3922,11 @@ class ModuleAutoGen(AutoGen): if not os.path.isabs(File): File =3D os.path.join(self.OutputDir, File) if os.path.exists(File): - shutil.copy2(File, FileDir) + sub_dir =3D os.path.relpath(File, self.OutputDir) + destination_file =3D os.path.join(FileDir, sub_dir) + destination_dir =3D os.path.dirname(destination_file) + CreateDirectory(destination_dir) + shutil.copy2(File, destination_dir) =20 def AttemptModuleCacheCopy(self): # If library or Module is binary do not skip by hash @@ -3944,7 +3= 950,11 @@ class ModuleAutoGen(AutoGen): shutil.copy2(HashFile, self.BuildDir) else: File =3D path.join(root, f) - shutil.copy2(File, self.OutputDir) + sub_dir =3D os.path.relpath(File, FileDir) + destination_file =3D os.path.join(self.Out= putDir, sub_dir) + destination_dir =3D os.path.dirname(destin= ation_file) + CreateDirectory(destination_dir) + shutil.copy2(File, destination_dir) if self.Name =3D=3D "PcdPeim" or self.Name =3D=3D "Pcd= Dxe": CreatePcdDatabaseCode(self, TemplateString(), Temp= lateString()) return True -- 2.19.1.windows.1