summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Trim
diff options
context:
space:
mode:
authorYingke Liu <yingke.d.liu@intel.com>2015-08-06 08:05:59 +0000
committeryingke <yingke@Edk2>2015-08-06 08:05:59 +0000
commit55668ca24539f8db03c8daac6bba5c4f47a53585 (patch)
treee0a04627cd66440e591a4a469eb549f5e0a440a4 /BaseTools/Source/Python/Trim
parent3cf6450eb581961e3618d29117b09b22605c99cd (diff)
downloadedk2-platforms-55668ca24539f8db03c8daac6bba5c4f47a53585.tar.xz
BaseTools/Trim: Fixed a bug that cannot trim long values
The long value substitution must move to the front of HEX substitution, and updated build_rule to add --trim-long Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18170 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Trim')
-rw-r--r--BaseTools/Source/Python/Trim/Trim.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python/Trim/Trim.py
index 7df83649d0..8fefa1bcd9 100644
--- a/BaseTools/Source/Python/Trim/Trim.py
+++ b/BaseTools/Source/Python/Trim/Trim.py
@@ -177,13 +177,13 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
EdkLogger.verbose("Found original file content starting from line %d"
% (LineIndexOfOriginalFile + 1))
+ if TrimLong:
+ Line = gLongNumberPattern.sub(r"\1", Line)
# convert HEX number format if indicated
if ConvertHex:
Line = gHexNumberPattern.sub(r"0\2h", Line)
else:
Line = gHexNumberPattern.sub(r"\1\2", Line)
- if TrimLong:
- Line = gLongNumberPattern.sub(r"\1", Line)
# convert Decimal number format
Line = gDecNumberPattern.sub(r"\1", Line)