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 <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
Carsey, Jaben 2019-01-17 23:35:07 +08:00 committed by Feng, Bob C
parent 1bcc2cd63d
commit 5c5ca9f1fb
2 changed files with 2 additions and 8 deletions

View File

@ -1904,12 +1904,6 @@ class SkuClass():
else: else:
return 'DEFAULT' return 'DEFAULT'
#
# Pack a registry format GUID
#
def PackRegistryFormatGuid(Guid):
return PackGUID(Guid.split('-'))
## Get the integer value from string like "14U" or integer like 2 ## 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 # @param Input The object that may be either a integer value or a string

View File

@ -20,7 +20,7 @@ from .GenFdsGlobalVariable import GenFdsGlobalVariable, FindExtendTool
from CommonDataClass.FdfClass import CapsuleClassObject from CommonDataClass.FdfClass import CapsuleClassObject
import Common.LongFilePathOs as os import Common.LongFilePathOs as os
from io import BytesIO from io import BytesIO
from Common.Misc import SaveFileOnChange, PackRegistryFormatGuid from Common.Misc import SaveFileOnChange, PackGUID
import uuid import uuid
from struct import pack from struct import pack
from Common import EdkLogger from Common import EdkLogger
@ -66,7 +66,7 @@ class Capsule (CapsuleClassObject):
# #
# Use FMP capsule GUID: 6DCBD5ED-E82D-4C44-BDA1-7194199AD92A # Use FMP capsule GUID: 6DCBD5ED-E82D-4C44-BDA1-7194199AD92A
# #
Header.write(PackRegistryFormatGuid('6DCBD5ED-E82D-4C44-BDA1-7194199AD92A')) Header.write(PackGUID('6DCBD5ED-E82D-4C44-BDA1-7194199AD92A'.split('-')))
HdrSize = 0 HdrSize = 0
if 'CAPSULE_HEADER_SIZE' in self.TokensDict: if 'CAPSULE_HEADER_SIZE' in self.TokensDict:
Header.write(pack('=I', int(self.TokensDict['CAPSULE_HEADER_SIZE'], 16))) Header.write(pack('=I', int(self.TokensDict['CAPSULE_HEADER_SIZE'], 16)))