From: Jaben Carsey <jaben.carsey@intel.com>
To: edk2-devel@lists.01.org
Cc: Bob Feng <bob.c.feng@intel.com>, Liming Gao <liming.gao@intel.com>
Subject: [Patch V2 5/5] BaseTools/GenFds/Capsule: move function logic
Date: Thu, 17 Jan 2019 07:35:07 -0800 [thread overview]
Message-ID: <abd9c3e4d654add506cc3787df13ee50503eeeba.1547511539.git.jaben.carsey@intel.com> (raw)
In-Reply-To: <cover.1547511539.git.jaben.carsey@intel.com>
In-Reply-To: <cover.1547511539.git.jaben.carsey@intel.com>
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>
---
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/Python/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'
-#
-# 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/Python/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, FindExtendTool
from CommonDataClass.FdfClass import CapsuleClassObject
import Common.LongFilePathOs as os
from io import BytesIO
-from Common.Misc import 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-7194199AD92A'))
+ Header.write(PackGUID('6DCBD5ED-E82D-4C44-BDA1-7194199AD92A'.split('-')))
HdrSize = 0
if 'CAPSULE_HEADER_SIZE' in self.TokensDict:
Header.write(pack('=I', int(self.TokensDict['CAPSULE_HEADER_SIZE'], 16)))
--
2.16.2.windows.1
next prev parent reply other threads:[~2019-01-17 15:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-17 15:35 [Patch V2 0/5] cleanup shared functions Jaben Carsey
2019-01-17 15:35 ` [Patch V2 1/5] BaseTools/build/build: refactor and move functions Jaben Carsey
2019-01-18 0:17 ` Feng, Bob C
2019-01-17 15:35 ` [Patch V2 2/5] BaseTools/Workspace/InfBuildData: " Jaben Carsey
2019-01-18 0:17 ` Feng, Bob C
2019-01-17 15:35 ` [Patch V2 3/5] BaseTools/DscBuildData: move function Jaben Carsey
2019-01-18 0:17 ` Feng, Bob C
2019-01-17 15:35 ` [Patch V2 4/5] BaseTools/AutoGen: move functions Jaben Carsey
2019-01-18 0:17 ` Feng, Bob C
2019-01-17 15:35 ` Jaben Carsey [this message]
2019-01-18 0:18 ` [Patch V2 5/5] BaseTools/GenFds/Capsule: move function logic Feng, Bob C
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=abd9c3e4d654add506cc3787df13ee50503eeeba.1547511539.git.jaben.carsey@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox