From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 377B8211B85CE for ; Thu, 17 Jan 2019 16:18:05 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2019 16:18:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,489,1539673200"; d="scan'208";a="135607467" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 17 Jan 2019 16:18:04 -0800 Received: from fmsmsx161.amr.corp.intel.com (10.18.125.9) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 17 Jan 2019 16:18:04 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX161.amr.corp.intel.com (10.18.125.9) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 17 Jan 2019 16:18:04 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.196]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.239]) with mapi id 14.03.0415.000; Fri, 18 Jan 2019 08:18:02 +0800 From: "Feng, Bob C" To: "Carsey, Jaben" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [Patch V2 5/5] BaseTools/GenFds/Capsule: move function logic Thread-Index: AQHUrnpLtw0tFGSIdE+7v6ysB1OyMKW0KZJQ Date: Fri, 18 Jan 2019 00:18:01 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D16005DBDC@SHSMSX101.ccr.corp.intel.com> References: In-Reply-To: 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 Subject: Re: [Patch V2 5/5] BaseTools/GenFds/Capsule: move function logic 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: Fri, 18 Jan 2019 00:18:05 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Carsey, Jaben=20 Sent: Thursday, January 17, 2019 11:35 PM To: edk2-devel@lists.01.org Cc: Feng, Bob C ; Gao, Liming Subject: [Patch V2 5/5] BaseTools/GenFds/Capsule: move function logic Move PackRegistryFormatGuid logic from Common.Misc to this file. There were no other consumers of the function. As it is one line, just replace the logic without the separate function. v2 - change to fix the import statement Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py | 6 ------ BaseTools/Source/Python/GenFds/Capsule.py | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Pyth= on/Common/Misc.py index 5968a3de4e1f..a1bfc502477c 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -1906,12 +1906,6 @@ class SkuClass(): else: return 'DEFAULT' =20 -# -# Pack a registry format GUID -# -def PackRegistryFormatGuid(Guid): - return PackGUID(Guid.split('-')) - ## Get the integer value from string like "14U" or integer like 2 # # @param Input The object that may be either a integer value or a= string diff --git a/BaseTools/Source/Python/GenFds/Capsule.py b/BaseTools/Source/P= ython/GenFds/Capsule.py index df29c40dbd20..1cdbdcf7ba86 100644 --- a/BaseTools/Source/Python/GenFds/Capsule.py +++ b/BaseTools/Source/Python/GenFds/Capsule.py @@ -20,7 +20,7 @@ from .GenFdsGlobalVariable import GenFdsGlobalVariable, F= indExtendTool from CommonDataClass.FdfClass import CapsuleClassObject imp= ort Common.LongFilePathOs as os from io import BytesIO -from Common.Misc i= mport SaveFileOnChange, PackRegistryFormatGuid +from Common.Misc import SaveFileOnChange, PackGUID import uuid from struct import pack from Common import EdkLogger @@ -66,7 +66,7 @@ class Capsule (CapsuleClassObject): # # Use FMP capsule GUID: 6DCBD5ED-E82D-4C44-BDA1-7194199AD92A # - Header.write(PackRegistryFormatGuid('6DCBD5ED-E82D-4C44-BDA1-71941= 99AD92A')) + =20 + Header.write(PackGUID('6DCBD5ED-E82D-4C44-BDA1-7194199AD92A'.split('-' + ))) HdrSize =3D 0 if 'CAPSULE_HEADER_SIZE' in self.TokensDict: Header.write(pack('=3DI', int(self.TokensDict['CAPSULE_HEADER_= SIZE'], 16))) -- 2.16.2.windows.1