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
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user